Refactor mailchimp email and serviceUserProfiles #428
Merged
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.
What changes did you make?
Refactors email functionality for existing automated emails send from bloom - the Impact measurement email and the therapy feedback email. Replaces mandrill + mailchimp setup, with mailchimp automations and synced user profiles data to trigger email automations. The existing similar crisp functionality was refactored to improve the DRYness and performance - all service profile updates are handled together in serviceUserProfiles.ts
The logic flows are as follows:
Mailchimp automations will to trigger impact measurement email based on
signed_up_at
dateMailchimp automation will trigger therapy feedback email based on
first_therapy_session_at
dateThis PR completes the transition of existing emails for Bloom, however it is now much easier to send additional one-off and automated emails using mailchimp user fields, and/or mailchimp events
Why did you make the changes?
We are introducing mailchimp automations for our transactional (user-triggered) emails across Chayn services. We previously used Mandrill as an add on for transactional emails, which is currently being integrated into mailchimp. However mailchimps existing automations now seems to be the best tool for most of our email requirements, including our Bloom feedback emails. So we’re moving the current functionality for bloom emails to automations.