How to send AMP Emails from Pepipost – Part 2

 In About Email, Email Deliverability

In the first part of the series, you learnt about what is AMP in Email Technology and if you are a brand, how you can start sending AMP mails via Pepipost. This involves registering your domain with Google by testing an AMP ready email.

You also learnt details on how to create the HTML for AMP Emails and how to include dynamic images and links in them.

In this part, you’ll learn:

  • the MIME format necessary to create an AMP email
  • how to validate your content before sending and about the injection of these emails via Pepipost.
  • the various metrics for engagement and how they shall be tracked. 
  • how you can test the mails via Pepipost UI.

MIME format

It is recommended to have three types of HTML in your MIME structure:

  • Text / plain
  • Text / x-amp-html
  • Text/html

When a user replies to an AMP email or forwards it to someone else, then the x-amp-html part is stripped off and only text/html part is delivered. This is why it is important to create text/html part as well so as to send a static HTML if AMP-email is not delivered.

Also, some email clients will render the last part of MIME only meaning the text/html part will be delivered instead of x-amp-html.

The width of the content should be less than 800 pixels and minimum 3-4 scrolls for length. This is to avoid any cropping from ISPs.

Content Validation

This is a web-based validator where you can paste your finished AMP HTML code and test for any errors. This tool will show you all the inline validation errors.

You can find the validator here

Testing AMP Emails on Gmail

You will have to make sure that the dynamic settings on Gmail are enabled so that you can test the final AMP emails on your Gmail email address.

As shown in the figure below, go on settings of your Gmail account and enable the checkbox against Dynamic Email by giving permission to Google to display dynamic emails in your mailbox.

Now you can test your finished AMP Emails to your Gmail id and test for its content! 

Injection of AMP emails to Pepipost

The AMP HTML content is to be sent in tour email. You can use attributes to display dynamic values such as name, age as [%NAME%], [%AGE%]] etc.

Make sure you have added HTML in the content parameter which will be rendered in case AMP HTML does not work on a given client.

"personalizations": [ 

   { 

"recipient": "hi@welcom.com", 

"attributes": { 

"NAME": "Mike", 

"ACCOUNT_BAL": "100" 

}, 

"x-apiheader_cc": "ABDXYZ123", 

"x-apiheader": "ABCDXYZ123", 

"recipient_cc": [ 

"demo1@xyz.com", 

"demo2@xyz.com" 

] 

   } 

], 

"tags": "laborum deserunt proiden", 

"from": { 

"fromEmail": "xyz@yourdomain.com", 

"fromName": "imfalconideuser" 

}, 

"subject": "Welcome to Pepipost", 

"content": "Hi,[%NAME%] this is my first trial mail",

"ampcontent": "<html ⚡4email>

<head>

  <meta charset="utf-8">

  <script async src="https://cdn.ampproject.org/v0.js"></script>

  <style amp4email-boilerplate>body{visibility:hidden}</style>

</head>

<body>

  Hello, AMP4EMAIL world.

</body>

</html>",

"templateId": 7766, 

"attachments": [ 

   { 

"fileContent": "your base file content is base64 encoded", 

"fileName": "Myfilename.txt" 

   } 

], 

"settings": 

{ 

"footer": 1, 

"clicktrack": 0, 

"opentrack": 1, 

"unsubscribe": 0, 

"bcc": "mybcc@xya.com" 

}, 

"replyToId": "qwer@ppoi.com" 

}

 

As such Pepipost being a delivery Engine, which works on SMTP based injection, there will be no testing done via Pepipost UI.

In order to send an email using Pepipost API, you should be ready with all the

below prerequisites mentioned this documentation :

Step 1: Build your API call

Your API call must have the following components:

  • An Endpoint: Use https://api.pepipost.com/v2/ or select the one from the
  • which best meets your requirement.
  • An API Key within the
  • header.
  • A valid Request method. When submitting data to a resource use a valid allowed request method like POST, PUT, GET, PATCH and DELETE.
  • A valid payload. You must submit your payload in JSON format only.

Once you're ready with the above components, follow the next steps.

Step 2: Send your Email using the API

Using the cURL Method

Warning: Some samples are using curl utility for API examples. UNIX shells require that some characters must be escaped, for example $ becomes $. If your API key contains unescaped characters you may receive HTTP error 401 (Unauthorized).

  1. Copy the below cURL example:

curl --request POST \

--url https://api.pepipost.com/v2/sendEmail \

--header 'api_key: <YOUR_API_KEY>' \

--header 'content-type: application/json' \

--data '{"personalizations":[{"recipient":"steve@example.com","attributes":{"NAME":"Steve"}}],"tags":"OrderConfirmationEmail","from":{"fromEmail":"sales@yourdomain.com","fromName":"ABC Sales"},"subject":"Your Order is confirmed","content":"Hi,[%NAME%] this is my first test email"}'

 

  1. Paste the curl call into your favorite text editor.
  2. Copy your API key and paste it in the api_key header.
  3. In the data section, specify the recipient and from email addresses.

From/Sender address consists of the Sender domain, which needs to be

on Pepipost prior to initiate a test.

  1. Copy the code and paste it in your terminal.
  2. Hit Enter.
  3. Check the recipient’s inbox. You must have received the email.

The API documentation to make the SMTP API call to inject mails via Pepipost is provided in the below link: https://developers.pepipost.com/email-api/email-api/sendemail

Engagement metrics to be tracked

Following Open and Clicks metrics are to be tracked-

Opens:

A 1-pixel image will be added inserted the XHTML code to ensure that we are tracking the opens for the emails.

Clicks:

Currently, the click tracking is under testing phase and there will be an update on it, from the Pepipost development team soon. 

Once the click tracking has been enabled the add-to-cart sessions depend on a centralized JSON id which will be tracked on the website as well by Google.

As a result, if a user does an add-to-cart session on the email client and wishes to check out the product on the website, the same session id will be tracked on the website as well. So, the user will be able to see the same product on the website in the add-to-cart section.

Here is the documentation on how Pepipost collects opens and clicks stats for panels:

https://developers.pepipost.com/email-api/events-api/get-stats

Now you are ready to test your AMP Emails through Pepipost!

Found This Blog Interesting, Please Rate This Blog 1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Recent Posts

Leave a Comment

We are always looking for fresh talent to contribute to our blog. If you have a knack for writing and a passion for email marketing, we would love to have your post on our Guest Blog .

Submit a Guest Post
Pepi thinking

Start typing and press Enter to search

Thank you for your details!

Fill out your information below, and we will send you a PepiAlert, that will describe your domain’s email deliverability situation. Please note that your email address must match the domain, or the domain must be owned by the company matching the email address. We have the right to refuse the request, if we can’t verify the information.

*All fields are required