Skip to content

Commit

Permalink
[8.6] [Cases] Update email content and footer (#146036) (#146104)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.6`:
- [[Cases] Update email content and footer
(#146036)](#146036)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Christos
Nasikas","email":"christos.nasikas@elastic.co"},"sourceCommit":{"committedDate":"2022-11-23T09:04:26Z","message":"[Cases]
Update email content and footer (#146036)\n\n## Summary\r\n\r\nThis PR
replace `Kibana` with `Elastic` in the email content and
footer.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"ca2a0cadc3e031ed91a3886e131f796aaa1d11f1","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","Feature:Cases","Feature:Actions/ConnectorTypes","v8.6.0","v8.7.0"],"number":146036,"url":"https://github.com/elastic/kibana/pull/146036","mergeCommit":{"message":"[Cases]
Update email content and footer (#146036)\n\n## Summary\r\n\r\nThis PR
replace `Kibana` with `Elastic` in the email content and
footer.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"ca2a0cadc3e031ed91a3886e131f796aaa1d11f1"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146036","number":146036,"mergeCommit":{"message":"[Cases]
Update email content and footer (#146036)\n\n## Summary\r\n\r\nThis PR
replace `Kibana` with `Elastic` in the email content and
footer.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"ca2a0cadc3e031ed91a3886e131f796aaa1d11f1"}}]}]
BACKPORT-->

Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
  • Loading branch information
kibanamachine and cnasikas authored Nov 23, 2022
1 parent f42a22b commit b6907b8
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('EmailNotificationService', () => {
],
},
message:
'You are assigned to an Elastic Kibana Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\nTags: defacement\r\n\r\n\r\n\r\n[View the case details](https://example.com/app/security/cases/mock-id-1)',
'You are assigned to an Elastic Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\nTags: defacement\r\n\r\n\r\n\r\n[View the case details](https://example.com/app/security/cases/mock-id-1)',
subject: '[Elastic][Cases] Super Bad Security Issue',
to: ['damaged_raccoon@elastic.co', 'physical_dinosaur@elastic.co', 'wet_dingo@elastic.co'],
});
Expand All @@ -74,7 +74,7 @@ describe('EmailNotificationService', () => {
],
},
message:
'You are assigned to an Elastic Kibana Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\nTags: defacement\r\n\r\n\r\n\r\n[View the case details](https://example.com/app/security/cases/mock-id-1)',
'You are assigned to an Elastic Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\nTags: defacement\r\n\r\n\r\n\r\n[View the case details](https://example.com/app/security/cases/mock-id-1)',
subject: '[Elastic][Cases] Super Bad Security Issue',
to: ['damaged_raccoon@elastic.co', 'physical_dinosaur@elastic.co', 'wet_dingo@elastic.co'],
});
Expand Down Expand Up @@ -102,7 +102,7 @@ describe('EmailNotificationService', () => {
],
},
message:
'You are assigned to an Elastic Kibana Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\nTags: defacement\r\n\r\n\r\n\r\n[View the case details](https://example.com/app/security/cases/mock-id-1)',
'You are assigned to an Elastic Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\nTags: defacement\r\n\r\n\r\n\r\n[View the case details](https://example.com/app/security/cases/mock-id-1)',
subject: '[Elastic][Cases] Super Bad Security Issue',
to: ['physical_dinosaur@elastic.co'],
});
Expand All @@ -125,7 +125,7 @@ describe('EmailNotificationService', () => {
],
},
message:
'You are assigned to an Elastic Kibana Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\nTags: defacement\r\n\r\n\r\n\r\n[View the case details](https://example.com/app/security/cases/mock-id-1)',
'You are assigned to an Elastic Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\nTags: defacement\r\n\r\n\r\n\r\n[View the case details](https://example.com/app/security/cases/mock-id-1)',
subject: '[Elastic][Cases] Super Bad Security Issue',
to: ['damaged_raccoon@elastic.co', 'physical_dinosaur@elastic.co', 'wet_dingo@elastic.co'],
});
Expand Down Expand Up @@ -156,7 +156,7 @@ describe('EmailNotificationService', () => {
],
},
message:
'You are assigned to an Elastic Kibana Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\nTags: defacement\r\n\r\n\r\n\r\n[View the case details](https://example.com/s/test-space/app/security/cases/mock-id-1)',
'You are assigned to an Elastic Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\nTags: defacement\r\n\r\n\r\n\r\n[View the case details](https://example.com/s/test-space/app/security/cases/mock-id-1)',
subject: '[Elastic][Cases] Super Bad Security Issue',
to: ['damaged_raccoon@elastic.co', 'physical_dinosaur@elastic.co', 'wet_dingo@elastic.co'],
});
Expand Down Expand Up @@ -186,7 +186,7 @@ describe('EmailNotificationService', () => {
],
},
message:
'You are assigned to an Elastic Kibana Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\nTags: defacement\r\n\r\n',
'You are assigned to an Elastic Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\nTags: defacement\r\n\r\n',
subject: '[Elastic][Cases] Super Bad Security Issue',
to: ['damaged_raccoon@elastic.co', 'physical_dinosaur@elastic.co', 'wet_dingo@elastic.co'],
});
Expand All @@ -209,7 +209,7 @@ describe('EmailNotificationService', () => {
],
},
message:
'You are assigned to an Elastic Kibana Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\nTags: one, two\r\n\r\n\r\n\r\n[View the case details](https://example.com/app/security/cases/mock-id-1)',
'You are assigned to an Elastic Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\nTags: one, two\r\n\r\n\r\n\r\n[View the case details](https://example.com/app/security/cases/mock-id-1)',
subject: '[Elastic][Cases] Super Bad Security Issue',
to: ['damaged_raccoon@elastic.co', 'physical_dinosaur@elastic.co', 'wet_dingo@elastic.co'],
});
Expand All @@ -232,7 +232,7 @@ describe('EmailNotificationService', () => {
],
},
message:
'You are assigned to an Elastic Kibana Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\n\r\n\r\n[View the case details](https://example.com/app/security/cases/mock-id-1)',
'You are assigned to an Elastic Case.\r\n\r\nTitle: Super Bad Security Issue\r\n\r\nStatus: open\r\n\r\nSeverity: low\r\n\r\n\r\n\r\n[View the case details](https://example.com/app/security/cases/mock-id-1)',
subject: '[Elastic][Cases] Super Bad Security Issue',
to: ['damaged_raccoon@elastic.co', 'physical_dinosaur@elastic.co', 'wet_dingo@elastic.co'],
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class EmailNotificationService implements NotificationService {
publicBaseUrl?: IBasePath['publicBaseUrl']
) {
const lineBreak = '\r\n\r\n';
let message = `You are assigned to an Elastic Kibana Case.${lineBreak}`;
let message = `You are assigned to an Elastic Case.${lineBreak}`;
message = `${message}Title: ${theCase.attributes.title}${lineBreak}`;
message = `${message}Status: ${theCase.attributes.status}${lineBreak}`;
message = `${message}Severity: ${theCase.attributes.severity}${lineBreak}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ describe('params validation', () => {
"cc": Array [],
"kibanaFooterLink": Object {
"path": "/",
"text": "Go to Kibana",
"text": "Go to Elastic",
},
"message": "this is the message",
"subject": "this is a test",
Expand Down Expand Up @@ -508,7 +508,7 @@ describe('execute()', () => {
message: 'a message to you',
kibanaFooterLink: {
path: '/',
text: 'Go to Kibana',
text: 'Go to Elastic',
},
};

Expand Down Expand Up @@ -542,7 +542,7 @@ describe('execute()', () => {
--
This message was sent by Kibana.",
This message was sent by Elastic.",
"subject": "the subject",
},
"hasAuth": true,
Expand Down Expand Up @@ -593,7 +593,7 @@ describe('execute()', () => {
--
This message was sent by Kibana.",
This message was sent by Elastic.",
"subject": "the subject",
},
"hasAuth": false,
Expand Down Expand Up @@ -644,7 +644,7 @@ describe('execute()', () => {
--
This message was sent by Kibana.",
This message was sent by Elastic.",
"subject": "the subject",
},
"hasAuth": false,
Expand Down Expand Up @@ -707,7 +707,7 @@ describe('execute()', () => {
message: '{{rogue}}',
kibanaFooterLink: {
path: '/',
text: 'Go to Kibana',
text: 'Go to Elastic',
},
};
const variables = {
Expand All @@ -729,7 +729,7 @@ describe('execute()', () => {
],
"kibanaFooterLink": Object {
"path": "/",
"text": "Go to Kibana",
"text": "Go to Elastic",
},
"message": "\\\\*bold\\\\*",
"subject": "*bold*",
Expand All @@ -738,7 +738,7 @@ describe('execute()', () => {
`);
});

test('provides a footer link to Kibana when publicBaseUrl is defined', async () => {
test('provides a footer link to Elastic when publicBaseUrl is defined', async () => {
const connectorTypeWithPublicUrl = getConnectorType({
publicBaseUrl: 'https://localhost:1234/foo/bar',
});
Expand All @@ -752,11 +752,11 @@ describe('execute()', () => {
--
This message was sent by Kibana. [Go to Kibana](https://localhost:1234/foo/bar)."
This message was sent by Elastic. [Go to Elastic](https://localhost:1234/foo/bar)."
`);
});

test('allows to generate a deep link into Kibana when publicBaseUrl is defined', async () => {
test('allows to generate a deep link into Elastic when publicBaseUrl is defined', async () => {
const connectorTypeWithPublicUrl = getConnectorType({
publicBaseUrl: 'https://localhost:1234/foo/bar',
});
Expand All @@ -767,7 +767,7 @@ describe('execute()', () => {
...params,
kibanaFooterLink: {
path: '/my/app',
text: 'View this in Kibana',
text: 'View this in Elastic',
},
},
};
Expand All @@ -781,7 +781,7 @@ describe('execute()', () => {
--
This message was sent by Kibana. [View this in Kibana](https://localhost:1234/foo/bar/my/app)."
This message was sent by Elastic. [View this in Elastic](https://localhost:1234/foo/bar/my/app)."
`);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const ParamsSchemaProps = {
path: schema.string({ defaultValue: '/' }),
text: schema.string({
defaultValue: i18n.translate('xpack.stackConnectors.email.kibanaFooterLinkText', {
defaultMessage: 'Go to Kibana',
defaultMessage: 'Go to Elastic',
}),
}),
}),
Expand Down Expand Up @@ -396,12 +396,12 @@ function getFooterMessage({
}) {
if (!publicBaseUrl) {
return i18n.translate('xpack.stackConnectors.email.sentByKibanaMessage', {
defaultMessage: 'This message was sent by Kibana.',
defaultMessage: 'This message was sent by Elastic.',
});
}

return i18n.translate('xpack.stackConnectors.email.customViewInKibanaMessage', {
defaultMessage: 'This message was sent by Kibana. [{kibanaFooterLinkText}]({link}).',
defaultMessage: 'This message was sent by Elastic. [{kibanaFooterLinkText}]({link}).',
values: {
kibanaFooterLinkText: kibanaFooterLink.text,
link: `${publicBaseUrl}${kibanaFooterLink.path === '/' ? '' : kibanaFooterLink.path}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export function initPlugin(router: IRouter, path: string) {
cc: null,
bcc: null,
subject: 'email-subject',
html: `<p>email-message</p>\n<p>--</p>\n<p>This message was sent by Kibana. <a href=\"https://localhost:5601\">Go to Kibana</a>.</p>\n`,
text: 'email-message\n\n--\n\nThis message was sent by Kibana. [Go to Kibana](https://localhost:5601).',
html: `<p>email-message</p>\n<p>--</p>\n<p>This message was sent by Elastic. <a href=\"https://localhost:5601\">Go to Elastic</a>.</p>\n`,
text: 'email-message\n\n--\n\nThis message was sent by Elastic. [Go to Elastic](https://localhost:5601).',
headers: {},
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export default function emailTest({ getService }: FtrProviderContext) {
cc: null,
bcc: null,
subject: 'email-subject',
html: `<p>email-message</p>\n<p>--</p>\n<p>This message was sent by Kibana. <a href=\"https://localhost:5601\">Go to Kibana</a>.</p>\n`,
text: 'email-message\n\n--\n\nThis message was sent by Kibana. [Go to Kibana](https://localhost:5601).',
html: `<p>email-message</p>\n<p>--</p>\n<p>This message was sent by Elastic. <a href=\"https://localhost:5601\">Go to Elastic</a>.</p>\n`,
text: 'email-message\n\n--\n\nThis message was sent by Elastic. [Go to Elastic](https://localhost:5601).',
headers: {},
},
});
Expand All @@ -147,10 +147,10 @@ export default function emailTest({ getService }: FtrProviderContext) {
.then((resp: any) => {
const { text, html } = resp.body.data.message;
expect(text).to.eql(
'_italic_ **bold** https://elastic.co link\n\n--\n\nThis message was sent by Kibana. [Go to Kibana](https://localhost:5601).'
'_italic_ **bold** https://elastic.co link\n\n--\n\nThis message was sent by Elastic. [Go to Elastic](https://localhost:5601).'
);
expect(html).to.eql(
`<p><em>italic</em> <strong>bold</strong> <a href="https://elastic.co">https://elastic.co</a> link</p>\n<p>--</p>\n<p>This message was sent by Kibana. <a href=\"https://localhost:5601\">Go to Kibana</a>.</p>\n`
`<p><em>italic</em> <strong>bold</strong> <a href="https://elastic.co">https://elastic.co</a> link</p>\n<p>--</p>\n<p>This message was sent by Elastic. <a href=\"https://localhost:5601\">Go to Elastic</a>.</p>\n`
);
});
});
Expand All @@ -166,18 +166,18 @@ export default function emailTest({ getService }: FtrProviderContext) {
message: 'message',
kibanaFooterLink: {
path: '/my/path',
text: 'View my path in Kibana',
text: 'View my path in Elastic',
},
},
})
.expect(200)
.then((resp: any) => {
const { text, html } = resp.body.data.message;
expect(text).to.eql(
'message\n\n--\n\nThis message was sent by Kibana. [View my path in Kibana](https://localhost:5601/my/path).'
'message\n\n--\n\nThis message was sent by Elastic. [View my path in Elastic](https://localhost:5601/my/path).'
);
expect(html).to.eql(
`<p>message</p>\n<p>--</p>\n<p>This message was sent by Kibana. <a href=\"https://localhost:5601/my/path\">View my path in Kibana</a>.</p>\n`
`<p>message</p>\n<p>--</p>\n<p>This message was sent by Elastic. <a href=\"https://localhost:5601/my/path\">View my path in Elastic</a>.</p>\n`
);
});
});
Expand Down Expand Up @@ -325,8 +325,8 @@ export default function emailTest({ getService }: FtrProviderContext) {
cc: null,
bcc: null,
subject: 'email-subject',
html: `<p>email-message</p>\n<p>--</p>\n<p>This message was sent by Kibana. <a href=\"https://localhost:5601\">Go to Kibana</a>.</p>\n`,
text: 'email-message\n\n--\n\nThis message was sent by Kibana. [Go to Kibana](https://localhost:5601).',
html: `<p>email-message</p>\n<p>--</p>\n<p>This message was sent by Elastic. <a href=\"https://localhost:5601\">Go to Elastic</a>.</p>\n`,
text: 'email-message\n\n--\n\nThis message was sent by Elastic. [Go to Elastic](https://localhost:5601).',
headers: {},
},
});
Expand Down

0 comments on commit b6907b8

Please sign in to comment.