Mailchimp integration with Ory Actions
Mailchimp is an email marketing platform that provides tools and services to help businesses send marketing emails, newsletters, and automated campaigns to their customers. It allows you to create, manage, and send emails to your subscribers, as well as segment and target specific groups of subscribers based on their interests and behaviors.
There are two main subsystems of Mailchimp that are of interest:
- Mailchimp email campaign tools - available from the main Mailchimp dashboard, the campaign tools enable you to organize and manage mass mailings to specific audiences (subscriber lists).
- Mailchimp Transactional Email - available from the Mandrill app dashboard, Mailchimp transactional email is a paid optional add-on for Mailchimp for managing transactional emails, which are user-specific emails sent to one user at a time.
In fact, it is the transactional email subsystem that is most relevant to the Ory integration use case. A transactional email is an automated email message sent to an individual user, in response to some event or interaction with your application. For example, when a user signs up to your website for the first time, this might trigger a welcome email to be sent to their email address. This is where the integration with Ory comes in. You can configure Ory Actions to trigger transactional emails in response any event that occurs in a self-service flow such as login, registration, or account validation.
The advantage of integrating Ory with the Mailchimp Transactional Email system is that Mailchimp sends these emails on your behalf and is able to track all of the transactional emails that pass through the system. You can use the Mandrill dashboard to track all of the inbound and outbound transactional emails and generate reports and analytics for this email traffic.
How Ory integrates with Mailchimp
The following diagram illustrates how Ory integrates with the Mailchimp Transactional Email system. In this particular example, we consider the case where a transactional email is triggered immediately after a user signs up.
In this example, the transactional email is triggered as follows:
- The end user signs up to a new account, completing the registration self-service flow.
- Upon completion, the registration flow triggers any actions registered under the
flows.registration.after.hooks
section of Ory Identities configuration. - The hook for Mailchimp Transactional Email, registered under
flows.registration.after.hooks
is now triggered, and Ory evaluates the Jsonnet email template, personalizing the content with the user's name and email address. - The Ory action forwards the content of the email to Mailchimp by invoking an API endpoint on the Mailchimp Transactional Email system.
- Mailchimp imports the email into its email system and then sends the transactional email to the end user on behalf of your email domain.
If you plan to send a transactional email that includes the header From: info@{your-domain}.com
, you need to configure Mailchimp
so that it has the authority to send (and receive) emails for the {your-domain}.com
email domain.