Skip to content

[ResponseOps][Reporting] Add email cc, bcc, subject and message fields to scheduled reports email#242922

Merged
umbopepato merged 34 commits intoelastic:mainfrom
umbopepato:2084-scheduled-reports-email-body-form
Nov 28, 2025
Merged

[ResponseOps][Reporting] Add email cc, bcc, subject and message fields to scheduled reports email#242922
umbopepato merged 34 commits intoelastic:mainfrom
umbopepato:2084-scheduled-reports-email-body-form

Conversation

@umbopepato
Copy link
Member

@umbopepato umbopepato commented Nov 13, 2025

📄 Summary

  • Adds new fields to the scheduled reports flyout form:
    • cc and bcc recipients fields,
    • subject and message with Mustache support
  • Makes the email fields editable for previously created schedules
  • Fixes some unit tests that were passing but were using a wrong format for scheduled reports sent to the form component
  • Adds unit tests and improve existing ones
  • Adds basic functional tests for scheduled reports flyout

🧪 Verification steps

✅ Happy Path

  1. Configure a working default email connector in your kibana.yaml, i.e. a local mailhog instance:
    notifications.connectors.default.email: email
    xpack.actions.preconfigured:
      email:
        name: 'Default email connector'
        actionTypeId: '.email'
        config:
          service: other
          from: testsender@test.com
          host: 0.0.0.0
          port: 1025
          secure: false
          hasAuth: false
  2. Schedule an export (i.e. of a Dashboard or Discover session)
  3. In the flyout, select "Send by email"
  4. Add at least one recipient
  5. Add a subject and message, with variable interpolations
  6. Wait for the export to be scheduled
  7. In the email service you configured, check that the reported email contains the expected subject and message

⚡️ Edge Cases

Schedule an export with a non-existent variable in the email message. The resulting text should ignore the invalid variable.

❌ Failure Cases

Schedule an export with one or more syntax errors in the template. The resulting email messages should include a debug message for the user to correct the template.

📷 Screenshots

image

⏪ Backport rationale

Not backporting since this is a new functionality

🔗 References

Closes https://github.com/elastic/kibana-team/issues/2084

Release Notes

Adds new fields to the schedule export form email notification section: cc and bcc recipients, subject and message with Mustache templating support

☑️ Checklist

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • (📝 Docs issue) Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • (⌛ running) Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.
@umbopepato umbopepato added backport:skip This PR does not require backporting Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// release_note:feature Makes this part of the condensed release notes v9.3.0 labels Nov 13, 2025
@umbopepato umbopepato force-pushed the 2084-scheduled-reports-email-body-form branch from 3eb4780 to a91dfac Compare November 17, 2025 10:50
@umbopepato umbopepato marked this pull request as ready for review November 17, 2025 16:36
@umbopepato umbopepato requested a review from a team as a code owner November 17, 2025 16:36
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@umbopepato umbopepato force-pushed the 2084-scheduled-reports-email-body-form branch from a91dfac to 1427b87 Compare November 21, 2025 10:40
? {
email: {
to: emailRecipients,
cc: emailCcRecipients,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cc and bcc fields were already supported by the backend but not on the FE, added these too

[http.basePath]
);
const { defaultTimezone } = useDefaultTimezone();
const hasCcBcc =
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seemed weird to be able to click the cc bcc toggle in editMode so I removed it and automatically showed the fields only if they have a value:

Image

cc @tiamliu

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit: now that those are editable I reenabled the Cc Bcc button, but kept the auto-show logic in edit mode for ease of use

(
validateEmailAddresses: ActionsPublicPluginSetup['validateEmailAddresses']
): ValidationFunc<ScheduledReport, string, string> =>
): ValidationFunc<Partial<ScheduledReport>, string, string> =>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to make this partial to avoid type errors with FormData being only a subset of ScheduledReport

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#9885

[❌] x-pack/platform/test/reporting_functional/reporting_and_security.config.ts: 0/50 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#9891

[❌] x-pack/platform/test/reporting_functional/reporting_and_security.config.ts: 0/50 tests passed.

see run history

Copy link
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the whole end-to-end workflow, and it is working as expected! Are there any PM requirements where the email address, the text, and the subject cannot be changed for a user with full access? Same, for a user without the scheduled reporting feature privilege, but for the subject and the message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a test in x-pack/platform/plugins/private/reporting/public/management/components/create_scheduled_report_form.test.tsx for the new functionality?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially added some tests there, but I ended up writing some functional tests in disguise that took an absurd amount of time to run (I had to increase the timeout to 15 seconds to pass CI 🤯). After all this component is a thin wrapper on top of the form and I was testing well beyond its code, and since I did write some actual functional tests for the entire flyout experience in this PR, I switched to testing the actual code of this component and leave the entire flow to fn tests

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it makes sense to me!

Copy link

@joana-cps joana-cps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit in the scheduled form:

  • The space between fields it's too big. I think 8px is enough and we can also use16px if needed.
  • There's no need for the help text in the To field to be that long. Suggestion to change to: We'll also email the report to the addresses you specify here.
    Example:
Screenshot 2025-11-21 at 17 12 33

Subject and Message fields

  • Should we have a default text in the subject and message field? I know they are optional fields but I think would be a nice insentive to avoid empty subject and message all the time. cc: @nastasha-solomon

  • I would change the subject to required field, it's weird to allow it to send emails with empty subject and message. Might be tagged as spam right away.

Copy link

@joana-cps joana-cps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I can still add variables in all the fields, even if they are disabled.
Screenshot 2025-11-21 at 17 23 06
  • This might have been a product, prioritization decision, but why can't I change email fields when editing a schedule?
    In this case I only added 1 email, and I'm a superuser. I should at least be able to disable the Send by email option. cc: @tiamliu @cnasikas
Copy link

@joana-cps joana-cps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, there are no deprecated variables here. Can we remove this until there is?
Screenshot 2025-11-21 at 17 42 24

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#9892

[❌] x-pack/platform/test/reporting_functional/reporting_and_security.config.ts: 0/200 tests passed.

see run history

@nastasha-solomon
Copy link
Contributor

Should we have a default text in the subject and message field? I know they are optional fields but I think would be a nice insentive to avoid empty subject and message all the time.

This is a great idea! Emails with empty subject lines and bodies could easily be ignored or end up in folk's spam folder.

@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner November 25, 2025 15:20
@umbopepato
Copy link
Member Author

umbopepato commented Nov 25, 2025

  • The space between fields it's too big. I think 8px is enough and we can also use16px if needed.

There was an extra EuiFlexGroup which I now realize it's probably useless. Removing it just restored the natural EuiDescribedFormGroup children flow with margins, which should match your expectations. Let me know if it doesn't, and thanks for the heads up!

  • There's no need for the help text in the To field to be that long. Suggestion to change to: We'll also email the report to the addresses you specify here.

Agree, but I had to shorten variant that non-reporting-manager users see (they can only email to themselves so this field is disabled), hope it's fine!

  • Should we have a default text in the subject and message field? I know they are optional fields but I think would be a nice insentive to avoid empty subject and message all the time. cc: @nastasha-solomon
  • I would change the subject to required field, it's weird to allow it to send emails with empty subject and message. Might be tagged as spam right away.

About these last two points: email subject and message weren't editable before these couple of PRs and had a default hard-coded value, which we keep assigning as default values if the user doesn't set them. So we they do have default values, they're just not visible to the user right away from the UI. I used help texts and placeholders to clarify this and guide the user. We could pre-compile the two fields with the default values in the UI too, but we'd need to keep doing it in the backend regardless; idk how much sense does it make to do it everywhere.
Also, while writing these texts I realized that we weren't giving any clue to the user about Mustache and markdown, so I added a bit of guidance on that as well:

image
@umbopepato
Copy link
Member Author

  • I can still add variables in all the fields, even if they are disabled.

Thanks again for finding this, I initially fixed it but...

  • This might have been a product, prioritization decision, but why can't I change email fields when editing a schedule?
    In this case I only added 1 email, and I'm a superuser. I should at least be able to disable the Send by email option. cc: @tiamliu @cnasikas

... as you could tell from the external conversations on this last point, things have changed a bit and I now enabled editing of all email fields, so I reverted the fix 😂

@umbopepato
Copy link
Member Author

Currently, there are no deprecated variables here. Can we remove this until there is? Screenshot 2025-11-21 at 17 42 24

I inherited this component from actions and didn't want to change it too much, but this is a fairly small change, so I just went ahead and did it. This might have a small impact in functional tests of actions, let's see what happens in CI 🤞

@umbopepato umbopepato requested review from a team as code owners November 25, 2025 16:46
@umbopepato
Copy link
Member Author

umbopepato commented Nov 27, 2025

About these last two points: email subject and message weren't editable before these couple of PRs and had a default hard-coded value, which we keep assigning as default values if the user doesn't set them. So we they do have default values, they're just not visible to the user right away from the UI. I used help texts and placeholders to clarify this and guide the user. We could pre-compile the two fields with the default values in the UI too, but we'd need to keep doing it in the backend regardless; idk how much sense does it make to do it everywhere.
Also, while writing these texts I realized that we weren't giving any clue to the user about Mustache and markdown, so I added a bit of guidance on that as well:

We don't need to overcomplicate here. I suggest using the default texts that we already have and pre-filling the subject and the message fields. By doing that, we're already showing that it supports mustache and markdown (because we show it in our default message, no need for helper text). And as a plus, we're giving the user a starting point. win win 🙂

Let me or @nastasha-solomon know if there's any need to improve those defaults.

Done! The previous fallback values set by the backend weren't i18nalized so I took the occasion and created translations for them shared by both server and client 🙂

I left a bit of hint below the message textarea because there wasn't anything hinting to markdown support

legend: 'Repeat on weekday',
options: WEEKDAY_OPTIONS,
isDisabled: readOnly,
...(compressed ? { buttonSize: 'compressed' } : {}),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Form hook lib doesn't type these props objects so some of these compressed, isDisabled and readOnly props were passed the wrong way and ended up being passed to HTML elements, causing a lot of React error logs. All should be fixed now


import { i18n } from '@kbn/i18n';

export const SCHEDULED_REPORT_FORM_EMAIL_SUBJECT_DEFAULT_VALUE = i18n.translate(
Copy link
Member Author

@umbopepato umbopepato Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These default subject and message texts were not translated in the backend so I added common versions for both FE and BE.
Read here to know more

jest.mock('../apis/get_reporting_health');

const mockValidateEmailAddresses = jest.fn().mockResolvedValue([]);
const mockValidateEmailAddresses = jest.fn().mockReturnValue([]);
Copy link
Member Author

@umbopepato umbopepato Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original fn is not async

jest.mock('../apis/schedule_report');

const mockValidateEmailAddresses = jest.fn().mockResolvedValue([]);
const mockValidateEmailAddresses = jest.fn().mockReturnValue([]);
Copy link
Member Author

@umbopepato umbopepato Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original fn is not async

renderWithProviders(<ScheduledReportForm {...props} />);
describe('when in readonly mode', () => {
it('disables title', async () => {
renderWithProviders(<ScheduledReportForm {...defaultProps} readOnly />);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the props to the JSX el itself so they're typed

.then(({ body }) =>
expect(body.message).toMatchInlineSnapshot(
`"[request body.notification.email.to]: could not parse array value from json input"`
expect(body.message).toEqual(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These somehow started failing even though the error message was exactly the same as the expected one. toEqual works though

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#9934

[❌] x-pack/platform/test/reporting_functional/reporting_and_security.config.ts: 44/50 tests passed.

see run history

Copy link
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tested and it is working fine! Thanks for the extra effort with the update.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Let's add a small unit test to check that the deprecated button is hidden.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, added ✅

{
defaultMessage: 'Your scheduled report is attached for you to download or share.',
description:
'The curly braces are Mustache interpolations, not translation variables, hence the single quotes around them.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: There are no interpolations in the message. Should we remove this?

Copy link
Member Author

@umbopepato umbopepato Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right thanks for the heads up!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it makes sense to me!

title,
schedule: { rrule: rrule as Rrule },
notification: {
email: sendByEmail
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is how ES works. Setting to null is the only option.

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#9936

[❌] x-pack/platform/test/reporting_functional/reporting_and_security.config.ts: 171/200 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#9943

[❌] x-pack/platform/test/reporting_functional/reporting_and_security.config.ts: 174/200 tests passed.

see run history

@umbopepato umbopepato enabled auto-merge (squash) November 28, 2025 14:18
@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#9947

[❌] x-pack/platform/test/reporting_functional/reporting_and_security.config.ts: 73/100 tests passed.

see run history

@umbopepato umbopepato merged commit f08de60 into elastic:main Nov 28, 2025
13 checks passed
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #147 / ObservabilityApp Custom threshold rule with ad-hoc data view should create a custom threshold rule with an ad-hoc data view
  • [job] [logs] FTR Configs #76 / serverless search UI - search features Search Playground - Saved Playgrounds Update Saved Playground should allow updating playground name

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
reporting 237 239 +2

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
triggersActionsUi 502 504 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
alerting 88.4KB 88.5KB +44.0B
reporting 138.2KB 143.9KB +5.7KB
total +5.7KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
reporting 41.4KB 41.6KB +146.0B
triggersActionsUi 106.7KB 107.0KB +293.0B
total +439.0B
Unknown metric groups

API count

id before after diff
triggersActionsUi 506 508 +2

ESLint disabled line counts

id before after diff
@kbn/test-suites-xpack-platform 161 162 +1

Total ESLint disabled count

id before after diff
@kbn/test-suites-xpack-platform 171 172 +1

History

tkajtoch pushed a commit to tkajtoch/kibana that referenced this pull request Dec 1, 2025
…s to scheduled reports email (elastic#242922)

## 📄 Summary

- Adds new fields to the scheduled reports flyout form:
  - cc and bcc recipients fields,
  - subject and message with Mustache support
- Makes the email fields editable for previously created schedules
- Fixes some unit tests that were passing but were using a wrong format
for scheduled reports sent to the form component
- Adds unit tests and improve existing ones
- Adds basic functional tests for scheduled reports flyout

<details>
<summary>

## 🧪 Verification steps

</summary>

### ✅ Happy Path
1. Configure a working default email connector in your kibana.yaml, i.e.
a local mailhog instance:
    ```yaml
    notifications.connectors.default.email: email
    xpack.actions.preconfigured:
      email:
        name: 'Default email connector'
        actionTypeId: '.email'
        config:
          service: other
          from: testsender@test.com
          host: 0.0.0.0
          port: 1025
          secure: false
          hasAuth: false
    ```
2. Schedule an export (i.e. of a Dashboard or Discover session)
3. In the flyout, select "Send by email"
4. Add at least one recipient
5. Add a subject and message, with variable interpolations
6. Wait for the export to be scheduled
7. In the email service you configured, check that the reported email
contains the expected subject and message

### ⚡️ Edge Cases
Schedule an export with a non-existent variable in the email message.
The resulting text should ignore the invalid variable.

### ❌ Failure Cases
Schedule an export with one or more syntax errors in the template. The
resulting email messages should include a debug message for the user to
correct the template.

</details>

<details>
<summary>

## 📷 Screenshots

</summary>

<img width="595" height="1066" alt="image"
src="https://github.com/user-attachments/assets/2ffecd32-70f4-4b9d-81a1-647d733ce297"
/>

</details>

## ⏪ Backport rationale

Not backporting since this is a new functionality

## 🔗 References

Closes elastic/kibana-team#2084

## Release Notes

Adds new fields to the schedule export form email notification section:
cc and bcc recipients, subject and message with Mustache templating
support

## ☑️ Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ] (📝 [Docs
issue](elastic/docs-content#4027))
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] ~~If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~~
- [ ] ~~This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.~~
- [ ] (⌛
[running](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/9934/steps/canvas))
[Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Dec 2, 2025
…s to scheduled reports email (elastic#242922)

## 📄 Summary

- Adds new fields to the scheduled reports flyout form:
  - cc and bcc recipients fields,
  - subject and message with Mustache support
- Makes the email fields editable for previously created schedules
- Fixes some unit tests that were passing but were using a wrong format
for scheduled reports sent to the form component
- Adds unit tests and improve existing ones
- Adds basic functional tests for scheduled reports flyout

<details>
<summary>

## 🧪 Verification steps

</summary>

### ✅ Happy Path
1. Configure a working default email connector in your kibana.yaml, i.e.
a local mailhog instance:
    ```yaml
    notifications.connectors.default.email: email
    xpack.actions.preconfigured:
      email:
        name: 'Default email connector'
        actionTypeId: '.email'
        config:
          service: other
          from: testsender@test.com
          host: 0.0.0.0
          port: 1025
          secure: false
          hasAuth: false
    ```
2. Schedule an export (i.e. of a Dashboard or Discover session)
3. In the flyout, select "Send by email"
4. Add at least one recipient
5. Add a subject and message, with variable interpolations
6. Wait for the export to be scheduled
7. In the email service you configured, check that the reported email
contains the expected subject and message

### ⚡️ Edge Cases
Schedule an export with a non-existent variable in the email message.
The resulting text should ignore the invalid variable.

### ❌ Failure Cases
Schedule an export with one or more syntax errors in the template. The
resulting email messages should include a debug message for the user to
correct the template.

</details>

<details>
<summary>

## 📷 Screenshots

</summary>

<img width="595" height="1066" alt="image"
src="https://github.com/user-attachments/assets/2ffecd32-70f4-4b9d-81a1-647d733ce297"
/>

</details>

## ⏪ Backport rationale

Not backporting since this is a new functionality

## 🔗 References

Closes elastic/kibana-team#2084

## Release Notes

Adds new fields to the schedule export form email notification section:
cc and bcc recipients, subject and message with Mustache templating
support

## ☑️ Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ] (📝 [Docs
issue](elastic/docs-content#4027))
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] ~~If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~~
- [ ] ~~This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.~~
- [ ] (⌛
[running](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/9934/steps/canvas))
[Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
JordanSh pushed a commit to JordanSh/kibana that referenced this pull request Dec 9, 2025
…s to scheduled reports email (elastic#242922)

## 📄 Summary

- Adds new fields to the scheduled reports flyout form:
  - cc and bcc recipients fields,
  - subject and message with Mustache support
- Makes the email fields editable for previously created schedules
- Fixes some unit tests that were passing but were using a wrong format
for scheduled reports sent to the form component
- Adds unit tests and improve existing ones
- Adds basic functional tests for scheduled reports flyout

<details>
<summary>

## 🧪 Verification steps

</summary>

### ✅ Happy Path
1. Configure a working default email connector in your kibana.yaml, i.e.
a local mailhog instance:
    ```yaml
    notifications.connectors.default.email: email
    xpack.actions.preconfigured:
      email:
        name: 'Default email connector'
        actionTypeId: '.email'
        config:
          service: other
          from: testsender@test.com
          host: 0.0.0.0
          port: 1025
          secure: false
          hasAuth: false
    ```
2. Schedule an export (i.e. of a Dashboard or Discover session)
3. In the flyout, select "Send by email"
4. Add at least one recipient
5. Add a subject and message, with variable interpolations
6. Wait for the export to be scheduled
7. In the email service you configured, check that the reported email
contains the expected subject and message

### ⚡️ Edge Cases
Schedule an export with a non-existent variable in the email message.
The resulting text should ignore the invalid variable.

### ❌ Failure Cases
Schedule an export with one or more syntax errors in the template. The
resulting email messages should include a debug message for the user to
correct the template.

</details>

<details>
<summary>

## 📷 Screenshots

</summary>

<img width="595" height="1066" alt="image"
src="https://github.com/user-attachments/assets/2ffecd32-70f4-4b9d-81a1-647d733ce297"
/>

</details>

## ⏪ Backport rationale

Not backporting since this is a new functionality

## 🔗 References

Closes elastic/kibana-team#2084

## Release Notes

Adds new fields to the schedule export form email notification section:
cc and bcc recipients, subject and message with Mustache templating
support

## ☑️ Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ] (📝 [Docs
issue](elastic/docs-content#4027))
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] ~~If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~~
- [ ] ~~This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.~~
- [ ] (⌛
[running](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/9934/steps/canvas))
[Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:feature Makes this part of the condensed release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v9.3.0

7 participants