A transactional email is a type of email that’s triggered by user action on a website. Some common examples of transactional emails include order shipment confirmations, account activation emails, password resets, invoices and receipts, and welcome emails.


How are transactional emails different from marketing emails?

Transactional emails are triggered by specific user actions and are sent individually. Marketing emails– sent in bulk or as a part of a journey– on the other hand, are one-to-many emails that are user-driven. Additionally, marketing emails require subscribers to opt-in to receive, like email newsletters and product updates. Hence, transactional emails generally enjoy much higher open rates when compared with marketing emails.


To understand this better, let’s consider an example. Let us set up a cart order journey email. In this case, the email follows a template similar to this:


Hi <first_name>,  your order no. <order_no> containing <product_name> has been placed successfully and will be delivered latest by <tentative_delivery_date>

Total bill amount is Rs. <bill_amount>


This email is triggered and sent to the customer every time a purchase is made on the website. The template contains variables that can be filled in with relevant details sent from the website every time a transaction is completed. This can be accomplished by configuring an API call on your website that pushes transaction data in Freshmarketer.


Setting up the API call on your website (developer assistance required):


To send Transactional Emails using Freshmarketer, configure your website and add relevant Freshmarketer API in order to enable Freshmarketer to receive data from the website and fill the personalization tokens. To know more, refer to developer.freshmarketer.com.


Before configuring Transactional Emails on Freshmarketer, it is vital to set up triggers and define the supported variables that will initiate the email and fill the personalization tokens in the outbound email. This can be configured on your website by using Freshmarketer API. Your website will use a POST API call to send the payload to Freshmarketer which in turn will fill in the template and send it to the relevant contact.


NOTE: In order to trigger the API, the respective transactional email has to be in running status. 


Request URL to trigger the API -

POST 
/mas/api/v1/mail/transactional


Attributes :


Personalization Fields
Token (Assigned in your backend)
Sample Value of Token (Passed through API)
First Name
first_name
"Jack"
Order ID
order_id
"42735gh"
Items Purchased
items_purchased
12
Amount Paid by User
order_value
300
Expected Date of Delivery
delivery_date
"2020-08-19 16:00:00+0000"
Shipping Address
address
"15, Kenneth Avenue, Madison, Wisconsin, USA"


Transactional Payload:

id
string
UUID of the created for the Transactional Email
tokens
JSON object
Transaction Merge Tag Token
recipient
string
Email Id to whom the email needs to be sent



Sample Code:

curl -X POST

"http://yourdomain.freshmarketer.com/mas/api/v1/mail/transactional"
-H "fm-token: uui1tsmoao924im5n0i1f3rm7q37547flbvomggj"
-H "accept: application/json"
-H "Content-Type: application/json" -d
'{
  "id": "3970a1b0-6e27-448a-adfc-0083db15b2fb",
  "tokens": {
      "design_token1": "Hi",
      "design_token2": "Hello",
      "design_token3": "World",
      "subject_token1": "XYZ"
  },
  "recipient": "[email protected]"
}'



NOTE: The ID on your code should be taken from the ‘configure details’ section of your Transactional Email.  



Configuring Transactional email journeys on Freshmarketer:

Once the Freshmarketer APIs are configured into your website, 

  1. On your Freshmarketer account, click the icon and select Transactional Emails.

    This opens the Transactional Emails page.

  2. Click. Assign a name to your campaign and click

    This opens a new page where you can configure your campaign.

  3. Configure the campaign by adding the sender’s name, email address, reply-to address, and subject line for the email. You can also personalize the subject line with personalization tokens by clicking the button and choosing a relevant token.

    Click after completing this step. This opens the page where you can choose the templates to create your email.

    NOTE: Personalization tokens will only be fetched from the trigger API and Transactional emails will be sent to only those email addresses that are associated with a contact in Freshmarketer.

  4. Choose a relevant template from the list of templates. Freshmarketer provides a predefined set of templates of Transactional emails for you to choose from. You can also upload an HTML template.
    Hover on a template and click . This opens the template design page.

  5. Personalize the template for your Transactional email by adding personalization tokens wherever necessary. 

    In this case, you can add an order number field if you’ve configured the API call on your website to push the value into Freshmarketer.

    After personalizing the template, click. This opens the review page. 

  6. Review your email template, check for previews on mobile and desktop devices, and hit. This makes the campaign live. Alternatively, you can also schedule the campaign to start at a predefined time by clicking and opting for a schedule.
    Click the copy button to copy the ID and use it on the POST API configured into your website.



The campaign is now live and its running status can be viewed on the Transactional Emails page.


NOTE: In order to trigger the API, the respective transactional email has to be in running status.