Mailjet

Mailjet is a transactional email delivery and management service. Trigger template-based emails and manage email subscription lists from Swrve based on user actions within the app with the Swrve Mailjet integration.
Supported actions​
Swrve's Mailjet integration supports the following actions:
Outbound actions​
- Send a template-based email
- Subscribe user to an email list
- Unsubscribe user from an email list
Inbound actions​
- Process email delivery and email engagement events from Mailjet
Use cases​
Transactional emails​
Transactional emails are sent in response to a user’s real-time action in the app. For example:
- Send a welcome email after the customer completes the sign up process.
- Send a purchase receipt email after the customer completes a purchase.
Using the Mailjet connector, Swrve triggers a transactional email upon receipt of a selected user action that is configured as a mobile event. There are two main steps involved in triggering transactional emails via the Mailjet integration:
- Create a custom event in the Swrve SDK for the user action you want to use to trigger the email send process; for example, registration_complete.
- Create a rule in Swrve that is triggered on receipt of the designated event and uses the Send Email action to send the email.
The Send Email action configuration includes mandatory fields, such as the To and Sender email address. If the values vary by user and you want to include them as dynamic content when configuring the rule, ensure the values are included as part of the trigger event payload or set up in Swrve as a user property. If any of these values are the same for all the emails (for example,  From Name), you can configure it manually when setting up the rule.
Marketing email lists​
Marketing emails are bulk emails sent with minimal personalization to a set audience or list of users. Marketing emails are scheduled as opposed to triggered on a per-user basis. The target audience for a marketing email campaign are grouped as email lists. Management of such email lists and the scheduling of marketing email campaigns is done in Mailjet. Swrve is used only as a client to add or remove users from Mailjet-managed email lists.
For example, if you wanted to maintain an email list for users who have made in-app purchases, for retargeting purposes, you could create an email list called high_value_mobile_users in Mailjet and add users to the list (from Swrve) as and when the user makes their first purchase. Likewise, if the user opts out of receiving emails via an in-app message, the same user may be removed from an existing email list.
The action of removing or adding a user's email is triggered on receipt of a related event. In the above example, the arrival of the purchase event or the email_opt_out event could be used as a trigger in a rule in Swrve to implement the required list management behavior. There are two main steps involved in managing an email list via the Mailjet connector:
- Create a custom event in the Swrve SDK for the user action that you want to use to trigger the subscribe or unsubscribe action.
- Create a rule in Swrve that is triggered on receipt of the designated event and uses the Subscribe User or Unsubscribe User action to manage the email list.
The Subscribe/Unsubscribe User action configuration includes the mandatory field: Email. The email address value should be included as part of the trigger event payload or stored in Swrve as a user property to configure the rule.
Update user properties​
The Mailjet connector sends email delivery and engagement events to Swrve, which you can use as part of your campaign engagement analysis or to trigger actions in Swrve. For example, if the status of an email is returned as Blocked, use the Blocked event to trigger a rule in Swrve that updates the value of a user property called email_blocked to true. You could then target those users with a push notification instead.
Mailjet configuration​
In most instances, your CSM will set up your Mailjet configuration, however you might need to provide them with certain credentials. To view your active Swrve integrations, on the Manage menu, select Adaptors.
Step 1: To access the configuration settings, on the Mailjet card, select Configure.
Step 2: Complete the following fields as required:
| Field | Description |
|---|---|
| API Key | The Mailjet API key. |
| Secret Key | The Mailjet API private key. |
Step 3: To save the configuration settings, select Save.
After you select Save, the configuration status changes to Active and the Deactivate button is available. If you Activate or Deactivate the configuration at any time, the changes apply to both the outbound and inbound actions.
Mailjet actions​
This section describes the fields that are included when creating a new rule using the selected action. For certain inbound actions, Swrve automatically creates a rule, while your CSM will likely configure any outbound actions. Most fields have the option to manually enter the value or to select a user property from the list to have Swrve automatically populate the value when the rule is processed.
Send email​
Triggers a template-based email that is sent from Mailjet. Complete the following fields to include the values required to send the email.
| Field | Description |
|---|---|
| Sender | The sender's email address. This list is auto-populated from Mailjet. |
| From Name | The sender's name. |
| To | Comma separated list of recipient email addresses. |
| Subject | The subject of the email message. |
| Template ID | The email template the email should use. Email templates are managed in Mailjet. |
| Advanced | |
| Substitutions | Substitutions are used to personalize the email template with user-specific values. Each substitution tag is associated with a list of replacement text for that tag in the email template body. |
Subscribe user​
Adds a specific user to an email list that is maintained in Mailjet. Complete the following fields to include the values required to add the user to an email list.
| Field | Description |
|---|---|
| Contact List | The name of the contact list to which the user's email address will be added. |
| The user's email address. |
Unsubscribe user​
Removes a specific user from an email list that is maintained in Mailjet. Complete the following fields to include the values required to remove the user from an email list.
| Field | Description |
|---|---|
| Contact List | The name of the contact list from which the user's email address will be removed. |
| The user's email address. |
Inbound actions​
The Mailjet inbound actions use webhooks with the Mailjet system to receive asynchronous email delivery and engagement events. The webhooks are set up when you create your first email campaign. Mailjet sends the following events to Swrve:
| Event | Description |
|---|---|
| Blocked | The system anticipated certain delivery problems and blocked the email from being sent. |
| Bounced | Receiving server could not or would not accept message. |
| Click | Recipient clicked a link in the message. You need to enable Click Tracking to receive this type of event. |
| Open | Recipient has opened the message. You need to enable Open Tracking to receive this type of event. |
| Sent | Message has been sent successfully. |
| Spam | The recipient marked the message as spam. |