Email Yak Documentation
Navigation
  • Main Page
  • Quick Start Guide
  • How it works
  • Setup Your Domain
  • Sandbox
  • POST Requests
  • GET Requests
  • Domain Ownership
  • SPF Record
  • Push Email
  • Push Notifications
  • Parsed Data
  • Post Authentication
  • Status Codes
  • Register Domain
  • Register Address
  • Send Email
  • Get Email
  • Get Email List
  • Get All Email
  • Get New Email
  • Delete Email

Push Email

When an email is received that matches a domain or email address with a CallbackURL set and PushEmail set to True, a POST request will be sent to the CallbackURL with all information about the email included as a JSON object.

Push Email will mark the email as being "read" and so the email will not show up in subsequent calls to the "Get New Email" endpoint. This is intended and required in order to keep the email store in sync.

The request will have the Content-Type set to "application/json" and will need to be parsed by a JSON library before being used within your application. 

If anything but a HTTP status 200 is returned, the push will be retried every 5 minutes for the next 120 hours until a 200 response is received. 

Requirements

To receive push email, there are three requirements:
  • A public URL must be made available that accepts POST requests
  • CallbackURL set to a public URL on the registered Domain or Address
  • PushEmail set to True on the registered Domain or Address

POST Headers

The POST request will have these headers set by Email Yak:
  • Content-Type: application/json; charset=utf-8
  • X-Emailyak-Post-Auth: HMAC hex-digest of your API key and the raw body of the POST request. To find out more info, see Post Authentication.

POST JSON Data

EmailID - the email ID assigned to the email.

FromAddress - the original sender of the email.

FromName - the original name of the sender, if provided. 

ToAddress - the recipient of the email. The mailbox that actually received the email.

ToAddressList - a comma-separated list of all intended recipients of the email. All addresses listed on the email envelope under "To" will be included.

CcAddressList - a comma-separated list of all cc'd recipients of the email. All addresses listed on the email envelope under "Cc" will be included.

Subject - the subject of the email.

HtmlBody - the HTML body of the email. If an HTML body is not included, this field will still be included but it will be an empty string.

TextBody - the body of the email.

ParsedData - a list of key-value sets containing the information parsed from the email. Different data types may be parsed, depending on availability. To find out more or view a list of the current parsed data types, see Parsed Data.

Received - a datetime stamp of when the email was received.

Headers - a list of key-value pairs with the "Name" and "Value" of each individual header.

Attachments (if any) - a list of URL's where the attachment can be downloaded.
a list of key-value pairs

POST JSON Data Example

{
	"EmailID": "RandomEmailID",
	"FromAddress" : "sender@example.com",
	"ToAddress": "receiver1@example.com",
	"ToAddressList": "receiver1@example.com, receiver2@example.com",
	"CcAddressList": "receiver3@example.com, receiver4@example.com",
	"Subject" : "Test",
	"HtmlBody" : "<b>Hello</b>",
	"TextBody" : "Hello",
	"ParsedData" : [
		{"Type" : "DataType1", "Data" : "Value", "Key" : "Value"},
		{"Type" : "DataType2", "Data" : "Value", "Key" : "Value"}
	],
	"Received": "2010-09-11T15:55:23",
	"Headers" : [{"Name" : "Header Title", "Value" : "Value" }],
	"Attachments": [
		"https://files.emailyak.com/secret_random_key/readme.txt",
		"https://files.emailyak.com/secret_random_key/report.pdf",
	]
} 
Create a free website with Weebly