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": "", 

"attributes": { 

"NAME": "Mike", 

"ACCOUNT_BAL": "100" 


"x-apiheader_cc": "ABDXYZ123", 

"x-apiheader": "ABCDXYZ123", 

"recipient_cc": [ 






"tags": "laborum deserunt proiden", 

"from": { 

"fromEmail": "", 

"fromName": "imfalconideuser" 


"subject": "Welcome to Pepipost", 

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

"ampcontent": "<html ⚡4email>


  <meta charset="utf-8">

  <script async src=""></script>

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



  Hello, AMP4EMAIL world.



"templateId": 7766, 

"attachments": [ 


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

"fileName": "Myfilename.txt" 





"footer": 1, 

"clicktrack": 0, 

"opentrack": 1, 

"unsubscribe": 0, 

"bcc": "" 


"replyToId": "" 



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 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 \

--header 'api_key: <YOUR_API_KEY>' \

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

--data '{"personalizations":[{"recipient":"","attributes":{"NAME":"Steve"}}],"tags":"OrderConfirmationEmail","from":{"fromEmail":"","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:

Engagement metrics to be tracked

Following Open and Clicks metrics are to be tracked-


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


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:

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

Other related articles

Check if emails from your domain are landing in Spam - Email Blacklist Tool

Learn more about Email Validation

Pepipost SMTP V/S Sendgrid SMTP

Learn about AMP for Email

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

Pin It on Pinterest