Update Email Schedule

The updated email schedule detail would be responded if the payload is valid or an error if invalid or missing required fields. Cannot replace source in an existing email schedule.

Request#

PATCH /api/v1/email_schedules/<email_schedule_id>

Payload examples#

  • Update recipients
{
}
  • Change the title
{
"title": "Company Overview - v3"
}
  • Change the attachment format
{
"format": "csv"
}
  • Re-schedule sending email to 6:00 AM (UTC) every day
{
"schedule": {
"repeat": "0 6 * * *"
}
}

Fields#

General#

  • id: Numeric. Unique email schedule identifier
  • recipients: Array. List of email addresses.
  • bcc: Array. List of BCC addresses.
  • title: Text. Email subject. In default, source title will be used if title is not available.
  • body_text: Text. Text content inside email body.
  • format: Attachment format. Available values are txt, csv, excel, pdf or none. Default is excel.
  • options: Object. Optional fields. Please see the Options for detail.
  • schedule: Object. Please see the Schedule for detail.
  • filter_values: Object. Filter values applied in this report/dashboard. Please see the Filter Values reference for detail.

Options#

  • preview: Include preview inside email content. Default value true
  • include_pdf: Include a PDF of a report or the whole dashboard. The default value is false.
  • include_header: Include column headers in an attached file. The default is false. Not available if the format is none
  • selected_widgets: List of widget IDs are selected to include in the email. _all for selecting all widgets.
  • include_report_link: Include link to report / dashboard. The default is false.
  • dont_send_when_empty: Just send the email when data is available. The default is false.

Schedule#

  • repeat: Crontab expression. Example: 0 4 * * * will start a job at 4:00 AM everyday. You can check your crontab expression by using https://crontab.guru

    We recommend that you should change the repeat time to prevent anti-spam filter from your email provider. For example 0 4 * * * (job start at 4:00 AM) could be 1 4 * * * (job start at 4:01 AM) or 5 4 * * *(job start at 4:05 AM) . This will also help your database does not get overload when there are many email schedules that execute at the same time.

  • paused: Pause execution temporarily. The default is false.

Filter Values#

This object is mainly matched by the filter variable that you created inside Holistics. The default value will be used if you do not input any specific data to it.

For example, we need to update an email schedule that have time_period filter with the default value is week, category filter with the default value is all and date_range filter default is 2 days ago. The filter_values in the payload would be:

"filter_values": {
"time_period": "week",
"category": "_all",
"date_range": "2 days ago"
}