Skip to content

[ResponseOps][Reporting] Send email with report attachment for scheduled reporting task #216316

@ymao1

Description

@ymao1

Blocked on #216313

Summary

When the scheduled reporting task is available, we want to have to ability to send email notifications when a scheduled report is complete, along with an attachment containing the generated report. Similar to the notification service, we can have a config specifying which preconfigured email connector to use for this notification.

We propose a custom reporting email action that can be scheduled at the end of the scheduled report task that reads the base64 encoded generated PDF/PNG from the report document and adds it as an attachment to the email, subject to any max size limitations from nodemailer.

For this first iteration, we suggest a pre-populated email message. In the future, we can allow users to customize their email message.

There is some discussion of whether we should only email the person scheduling the report, pulling that email address directly from the user profile. The outcome of this discussion may change the definition of done below.

Definition of done

  • API updated to accept list of email recipients
  • Email recipients validated against configured allowlist (in actions config)
  • New reporting email action added that takes a doc ID in its action task params and reads the doc from the reporting index to get the base64 encoded attachment. Should try to reuse as much code from the existing email action as possible
  • Scheduled reporting task updated to schedule the reporting email action if a list of recipients is defined.
  • Connector data usage reporting considers attachment size of emails (https://github.com/elastic/response-ops-team/issues/209)

Metadata

Metadata

Assignees

Labels

Feature:Reporting:FrameworkReporting issues pertaining to the overall frameworkTeam:ResponseOpsPlatform ResponseOps team (formerly the Cases and Alerting teams) t//blocked

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions