Effective email strategies, particularly transactional emails, are vital in modern digital communication, ensuring customers receive timely and relevant information based on their interactions with a service or platform.
This blog post focuses on sending transactional emails from Salesforce and examines the limitations associated with Salesforce’s email capabilities. We will explore how leveraging Declarative Webhooks for API callouts to email vendors like SendGrid and Mailchimp can overcome these limitations.
We’ll delve into the various types of transactional emails and provide practical examples of both outbound and inbound callouts using Declarative Webhooks. This approach not only enhances your email strategy but also offers a robust alternative to Salesforce’s native email limits.
Emails can be broadly categorized into the following types:
Transactional Emails are triggered by user actions and contain information about a transaction or process initiated by the user. Examples include order confirmations, shipping notifications, password reset emails, and account-related alerts.
Marketing Emails are promotional, aimed at encouraging the recipient to take some commercial action. These include newsletters, promotional offers, product announcements, and sales notifications.
Notification Emails are similar to transactional emails but generally relate to non-transactional activities, such as social media updates, reminders, and activity alerts.
A transactional email is an automated email triggered by user actions on a website or application. These emails are not promotional but provide important information to the user, such as:
Transactional emails have higher open rates compared to marketing emails because they contain information the recipient is expecting or needs urgently.
Declarative Webhooks allows you to build integrations with most REST APIs with JSON calls inside Salesforce easily with few clicks.
It can execute integrations through Flow, buttons, scheduled batches, or Apex. Declarative Webhooks is free to use, so sign up for a trial here!
Key Features:
Different email vendors provide APIs to facilitate the sending of transactional emails. Here, we will look at two popular email service providers: SendGrid and Mailchimp.
SendGrid offers robust and scalable email APIs to send transactional emails. It provides features such as dynamic templating, tracking, and analytics.
Example: Sending an Order Confirmation Email with SendGrid
API Endpoint: https://api.sendgrid.com/v3/mail/send
Headers:
{
“Authorization”: “Bearer YOUR_API_KEY”,
“Content-Type”: “application/json”
}
Body:
Mailchimp’s Transactional Email service (previously Mandrill) is known for its reliability and powerful analytics.
Example: Sending a Password Reset Email with Mailchimp
API Endpoint: https://mandrillapp.com/api/1.0/messages/send.json
Headers:
{
“Content-Type”: “application/json”
}
Body:
Define the Entry Criteria
Define the entry criteria for your automation. This could be a new record creation, record update, or a specific field change and can be triggered from a Flow or an Apex trigger.
For this example, we’ll use an order creation Flow. Create a record triggered flow with the main object Order.
Add an apex action for calling the outbound template record when this flow is executed (when an order is created.)
Transactional Email Tracking with Declarative Webhooks
For sending transactional emails signing up for the trial account, go to the settings section and create a new API key.
In this example, we will track the status of transactional email already sent by Mandrill.
We need to create an Inbound Template to process the data sent by Mandrill. The first step is defining a request body, which you can find an example of here.
After defining the request body, it’s time to use Inbound Call Actions to track the status of the email.
The final step is setting up the webhook itself. Go to the Mandrill app and on the webhooks tab define a new webhook.
In our example we want to update records if the transactional email is bounced, so we subscribe to the bounce event. Setting up webhooks while maintaining them can be tricky, while testing be sure to check the best practices in the last section.
Declarative Webhooks can manage different types of transactional emails by setting up multiple callout template configurations, each with its own entry mechanism and API call details.
Salesforce has limits on the number of emails that can be sent per day. Using external email vendors like SendGrid and Mailchimp through Declarative Webhooks can help you bypass these limits while ensuring reliable email delivery.
Data Security:
Error Handling:
Scalability:
Compliance:
Using Declarative Webhooks to set up transactional email API callouts to various email vendors like SendGrid and Mailchimp provides a robust and flexible solution for keeping customers informed.
By leveraging the no-code capabilities of Declarative Webhooks, businesses can quickly implement and scale their email notifications without extensive development efforts.
We have covered the types of emails, the specifics of transactional emails, and provided detailed steps to configure and test transactional email API callouts using Declarative Webhooks. Additionally, we have discussed how these solutions can help circumvent Salesforce email limits, ensuring reliable and scalable email delivery.
For further information and advanced configurations, refer to the Declarative Webhooks documentation and support resources. Thanks for reading!
Thank you for following this quick guide.
If you want to learn more about Declarative Webhooks, please follow the links below:
More Integration Guides
© Omnitoria, All Rights Reserved.