Feat/comms module/email scheduler #1219
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR implements the scheduler flow for Email Notifications. The core scheduler functionality allows the user to configure a cron schedule on which Email Notifications are sent.
A related feature in this PR is the ability to resolve dataset field values in the email body when a dataset is configured as "Send Separate Email". For example, when Block 1 is configured as "Send Separate Email" (meaning each row of the dataset is handled independantly and sent to an email address extracted from a configured field of the dataset),
{{Block 1.createdBy.username}}is replaced with the corresponding value in the dataset. This is supported by a dropdown on the frontend to insert these values into the email body.An additional change required for one of the scenarios provided is the filter change in
all.ts. This change was implemented to allow the filtering of nested fields of type resources. Specifically, when using the "Weekly Senior Leadership Report" resource, the "comments" LIST field must be filtered to only include values whose modifiedAt value is within a certain range (field: comments - modifiedAt, operator: withinthelast, value: 1 minute), previously this filter would return all data in the dataset.Useful links
Type of change
How Has This Been Tested?
These changes have been tested by our internal QA team following scenarios provided by the client.
Screenshots
Dependencies
ACCESS_TOKEN_URL,CLIENT_ID,CLIENT_SECRET, andCS_SCOPE, which are used to provide client credentials authentication between the backend and function.Checklist:
( * == Mandatory )