Create rich, personalized marketing and transactional emails, and send them via Email API to capture your customers’ attention.
The Email API gives you the ability to send emails at scale. Use your API key to take the stress out of email marketing, with features such as:
- Email delivery monitoring and optimization
- The ability to edit the email body in HTML.
- Send SMS with low or high speed delivery times.
Sending an Email API
These instructions describe how you can send your first email message! Using cURL calls.
Before you can start using the Email API, you need to complete the following steps:
-
Get access credentials.
-
Get your API Key
-
Have cURL installed in your machine
-
If you want to send bulk emails, a sender email is required. You need to contact your account manager to verify an email address.
-
Amazon sends you an email providing the authorization to send bulk messages through your email address:
We send emails through Amazon SES services and are subject to their terms of use.
-
Click on the URL verification.
-
Before sending bulk Emails, we recomend you read the Email Best Practices section, because It's essential that you monitor the number of hard bounces in your email program, and that you remove hard-bouncing email addresses from your recipient lists. When email receivers detect a high rate of hard bounces, they assume that you don't know your recipients well. As a result, a high hard bounce rate can negatively impact the deliverability of your email messages. And your account could be suspended from sending more emails when the Bounce Rate is 5% or higher.
-
Congratulations! You can now start sending emails using your verified email address as the sender.
Your API call must have the following components:
-
A host -> The host requests are always [ https://elastic.messangi.me ]
-
An Authorization header -> Your API Key must be included in the Authorization header.
-
A request -> When submitting data to a resource via POST or PUT, you must submit your payload in JSON.
Send your Email message using the API
The steps to send an email message using the Email API are the following:
curl -X POST "https://elastic.messangi.me/crowsnest/v2/emails" -H "accept: application/json" -H "Authorization: Bearer <YOUR_API_KEY>" -H "Content-Type: application/json" -d "{\"to\":\"[email protected]\",\"from\":\"[email protected]\",\"text\":\"example text\",\"subject\":\"Email Subject\",\"externalId\":\"123456789abcde\",\"clientId\":\"48118112\",\"callbacks\":[\"string\"]}"
-
Copy the curl example above.
-
Paste the curl call into your favorite text editor.
-
Copy your API key and paste it in the
Authorization
header. In the example above, replace<YOUR_API_KEY>
with your API key. -
In the
data
section, specify the following parameters:
Parameter | Description |
---|---|
to | Email address of the recipient. |
from | Email address of the sender. |
text | Content of the email. This can be a simple text or HTML format. |
subject | Subject of the email |
externalId | Alphanumeric identifier that can be used for reporting purposes. For instance, you could set the name or ID of the action that originated this email so you can then identify where this API call is coming from. NOTE : This is optional and can be removed from the API call if not needed. |
clientId | Unique user identifier that can be used for reporting purposes. For instance, you could set the mobile number of the user receiving the email so you can then relate this email sent with a particular user. NOTE : This is optional and can be removed from the API call if not needed. |
callbacks | You can indicate one or more (separated by comma) webhook URLs to notify about the status of the email delivery. NOTE : This is optional and can be removed from the API call if not needed |
-
Copy the code and paste it in your terminal command.
-
Press Enter.
-
Check the inbox of the address you specified as the
to
email and see your message!
All responses are returned in JSON format. We specify this by sending the Content-Type header
,
Email best practices
Several factors can lead to your email program's success or failure. Understanding how an email is delivered and following certain best practices can increase your chances of reaching your customers' inboxes. Even when you have customers' interests in mind, you may still encounter situations that impact your messages. The following paragraphs contain some recommendations to ensure your email communications reach your intended audience.
Authentication
- Authenticate your domain with SPF. Sender Policy Framework (SPF) is an email validation standard that prevents email spoofing. Domain owners use SPF to tell email providers which servers can send emails from their domains.
- Sign your outbound mail with DKIM. DomainKeys Identified Mail (DKIM) is an email security standard designed to ensure that the domain owner authorized an email that claims to have come from a specific domain. It uses public-key cryptography to sign an email with a private key. Recipient servers can then use a public key published to a domain's DNS to verify that parts of the email have not been modified during the transit.
ADDING AN EMAIL SENDER
When adding an email sender to your account, you must contact your account manager or support team to get the TXT Records to authenticate your domain with SPF and DNS Records to sign outbound mail with DKIM.
The procedures for updating DNS records vary depending on which DNS or web hosting provider you use.
- Test your authentication settings. Sending an email to an ISP-based email address you own, such as a Gmail or Hotmail account, and inspecting the original message is one way to verify your domain configuration is correct. In the case of Gmail you can proceed as follows. After sending the email from the domain you intend to use to to your gmail account, open it, and see if you received the email from your domain. Check the Inbox as well as the Spam folders. If you find the email message you sent from the domain you intend to use, your email is authenticating. Gmail does not accept emails that do not authenticate. You can confirm this by inspecting the details of the email message.
To do this, open the received email message and on the header of the message, to the far right of the From select the kebab menu (three vertical dots). It will display several options, and you are interested in the Show Original. (See figure below).
This will result in a screen that displays a detailed view of the received message, and most importantly it will display the authentication that was performed on the message and against which domain and IP address. A sample screenshot is shown below.
Note in the figure above that the yourdomain refers to the domain you intend to use for your email messages on the platform. The description above is the desired outcome.
However, if the test email message is not received in your account, it is an indication that the domain is not being authenticated or signed.
Domain and "From" address considerations
- Think carefully about the addresses you send emails from. The "From" address is one of the first pieces of information your recipients see and, therefore, can leave a lasting first impression. Additionally, some ISPs associate your reputation with your "From" address.
- Avoid using a no-reply address, such as [email protected], as your "From" or "Reply-to" address. Using a no-reply@ email address sends your recipients a clear message: that you aren't offering them a way to contact you and that you're not interested in their feedback.
- Ensure that the WHOIS information for your domain is accurate. Maintaining an honest and up-to-date WHOIS record demonstrates that you value transparency and allows users to identify whether or not your domain is legitimate quickly.
Maintain a Clean List
- Implement a double opt-in strategy. When users sign up to receive an email from you, send them a message with a confirmation link, and wait to start sending them emails until they confirm their address by clicking that link. A double opt-in strategy helps reduce the number of hard bounces resulting from typographical errors. This type of organically grown list is the best bet for keeping a healthy subscription list.
- Perform minimal validation on addresses collected with a web-based form. For example, ensure that the addresses you collect are well-formed (that is, they are in the format [email protected]) and that they refer to domains with valid MX records.
- Use caution when allowing user-defined input to be passed unchecked. Forums registrations and form submissions present unique risks because the content is entirely user-generated, and spammers can fill out forms with their content. It's your responsibility to ensure that you only send emails with high-quality content.
- Avoid sending emails to standard alias (such as postmaster@, abuse@, suppor@, or noc@). Ensure that you only send messages to real people who want to receive them. This rule is especially true for standard aliases, which are customarily reserved for email watchdogs. These aliases can be maliciously added to your list as a form of sabotage to damage your reputation.
- Periodically purge your list form inactive users to keep your email list and reputation with email service providers healthy.
HARD BOUNCES
It's essential that you monitor the number of hard bounces in your email program, and that you remove hard-bouncing email addresses from your recipient lists. When email receivers detect a high rate of hard bounces, they assume that you don't know your recipients well. As a result, a high hard bounce rate can negatively impact the deliverability of your email messages.
Your account will be suspended from sending more emails when the Bounce Rate is 5% or higher.
Updated almost 2 years ago