Our SendGrid Migration Guide will make your move to Pepipost super easy and hassle free.

Before we get started, you need to know how to interpret different API terminologies between SendGrid and Pepipost. Our SendGrid Migration Guide will help you make an easy transition!

SendGrid term Pepipost term
personalizations recipients
custom args attributes
categories tags
X-SMTPAPI header X-APIHEADER
Domain whitelabel Sending domain

Migrating from SendGrid SMTP and SendGrid API

Whether you are integrated with SendGrid via SMTP or API, this guide provides you with steps for easy SendGrid migration to Pepipost.

Set up your Pepipost account

Setup your account on Pepipost, choosing either the Free plan or choosing a paid plan. Once you’ve chosen the plan, setting up your Pepipost account is just a two-step process:

  1. Signup and activate your account by clicking on the activation link received on your email.
  2. Configure the sender domain which you want to use for sending your emails.

Once the domain is verified and approved by our Compliance Team, you are all set to send emails from your Pepipost account.

Review our checklist for lists, suppression and other things to consider.

Integrating the API

API End Point:

Sendgrid: POST https://api.sendgrid.com/v3/mail/send HTTP/1.1

Sample SendGrid API v3 call:


{
“personalizations”: [
{
“to”: [
{
“email”: “john@example.com”
}
],
“subject”: “Hello, World!”
}
],
“from”: {
“email”: “from_address@example.com”
},
“content”: [
{
“type”: “text/plain”,
“value”: “Hello, World!”
}
]
}

Pepipost: POST https://api.pepipost.com/api/web.send.json HTTP/1.1

Sample Pepipost API call


POST /api/web.send.json HTTP/1.1
{
“api_key”:”yourapikey”,
“email_details”:{
“fromname”:”sender name”,
“subject”:”test email subject”,
“from”:”from@example.com”,
“replytoid”: “replytoid@example.com”,
“content”:”

Hi [%NAME%], This is a test email sent using Pepipost JSON/Email API

” }, “tags”: “AccountDeactivation, Verification”, “X-APIHEADER”: [“ID3″,”ID2”], “settings”:{ “footer”:”1″, “clicktrack”:”1″, “opentrack”:”1″, “unsubscribe”:”1″, “bcc”:”sac@test.com”, “attachmentid”:”1,3,4″, “template”:”101″, }, “recipients”:[“recipient1@example.com”,”recipient2@example.com”], “attributes”:{ “NAME”:[“NameOfFirstRecipient”,”NameOfSecondRecipient”], “AGE”:[“20″,”30”] }, “files”: { “attachment_example1.txt”: “VGhpcyBpcyB0aGUgY29udGVudCBvZiBhIHRlc3QgZmlsZS4K”, “attachment_example2.txt”: “VGhpcyBpcyB0aGUgY29udGVudCBvZiBhIHRlc3QgZmlsZSAyLgo=” } }

Example Response


HTTP/1.1 200 OK
{“message”:”SUCCESS”,”errorcode”: “0” ,”errormessage”:””}

Response Format

Name Description
message Its can have only 2 values – “SUCCESS” or “ERROR”
errorcode Pepipost API error code. Its value will be – 0 (zero) in case of success. In case of error it will be non-zero integer value.
errormessage Error specific error messages.

Here is a quick cheat chart to understand the terminology used in SendGrid and its equivalent in Pepipost.

API Terminology

JSON Parameter Type Required Details Equivalent Pepipost parameter name
to array[object] Yes recipients
email
name optional Not supported
cc cc
bcc bcc
email
name Not supported
subject subject
headers X-APIHEADER
substitutions optional attributes
from from
email
name optional Not supported
replyto replytoid
email
name Not supported
subject subject
content content
type Not supported
attachments files
template_id template
categories tags
footer footer

How to Personalize emails?

SendGrid: Personalizations > Substitutions

Pepipost: Attributes

Personalizing your transactional emails is a very common requirement. Example: The template for the successful order placement email will be same for all your customers. You can add different values, embedded inside the email, to make it specific to each customer. You can include the name of the customer, details of the product purchased, product image and the amount paid.

In SendGrid, the personalization is done within the parameter  “personalizations”. In Pepipost personalization is done within the parameter “attributes”.

Attributes is collection of key/value pairs. The data type is string and only underscore is allowed with no spaces.

SendGrid example on Personalization


{
“personalizations”: [{
“to”: [{
“email”: “recipient@example.com”
}],
“substitutions”: {
“%fname%”: “recipient”,
“%CustomerID%”: “CUSTOMER ID GOES HERE”
},
“subject”: “YOUR SUBJECT LINE GOES HERE”
}]
}

Pepipost example on Personalization


{
“recipients”:[“recipient1@example.com”,”recipient2@example.com”],
“attributes”:{
“NAME”:[“NameOfFirstRecipient”,”NameOfSecondRecipient”],
“AGE”:[“20″,”30”]
}
}

Tracking each email with internal custom values for your organization

SendGrid: X-SMTPAPI
Pepipost: X-APIHEADER

Whether you are using SMTP or API, Pepipost has the same parameter for both X-APIHEADER can be used to pass your custom values to us. You can pass a JSON encoded data in this parameter. The X-APIHEADER that you add will be stripped from the final email. You won’t see these headers in the final email.

SendGrid example of passing a custom tracking value in API:


{
“unique_args”: {
“invoice_id”: [
23274221,
81742290
]
}
}

Pepipost example of passing a custom tracking value in API:


{
“X-APIHEADER”: [“{“invoice_id”:”23274221”}”,”{“invoice_id”:”81742290”}”]
}

Tagging emails under various categories/groups

Tagging your Pepipost emails lets you easily search activity, compare stats, and more. Some examples of Tags are: “Invoice Emails”, “Forgot Password/OTP”, “Newsletters” etc. Add tags to emails while sending emails through API or SMTP.

Sendgrid example of passing a custom tracking value in API:

Usage SendGrid Pepipost
In API category tags
In SMTP X-SMTPAPI: {“category”: [“ForgotPassword”,”Trans”]} X-TAGS:””ForgotPassword”,”Trans”

SendGrid: Category
Pepipost: In API: tags

SendGrid example of passing category value in API:


{
“category”: [
“Forgot Password”,
“Transactional”
]
}

Pepipost example of passing category value in API:


{
“tags”: “Forgot Password,Transactional”
]
}

Important Note: Before running your first test email through Pepipost API, you need to ensure that your sender domain is configured and approved under your Pepipost Account. This is similar to how you whitelist domains in SendGrid.

Just determine which SDK you want and get started with Pepipost. Explore our complete API documentation for details. We support:

    • PHP
    • Python
    • Ruby
    • NodeJS
    • NodeJS – Nodemailer
    • Java
    • Perl
    • C#

You can try every endpoint in the Pepipost API right from your browser using our Live API Explorer. There’s no longer a need to run cURL commands in terminal to test things out (though it’s totally fine if that’s your preference).

At Pepipost, we believe in keeping things simple and easy. Should you still face trouble migrating from SendGrid or have any questions, just ping us on our 24X7 live chat support and our developer evangelists will be happy to walk you through the migration process. Alternatively, you may email support@pepipost.com.

Ready to get started?

Get started with 30,000 emails/month free!

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