Send email

Endpoint

Endpoint: POST emails

When you want to send e-mail messages, you use the call data type below.

Call data type

At its core, the email sending endpoint needs the following values:

{ "senderName": "iP.1 Networks AB", "senderAddress": "info@ip1.se", "recipients": [ "info@othercorp.com", "billing@othercorp.com" ], "subject" : "Test message", "type": "Text", "body": "This is a simple test message" }

This call will immediately send an email message to each specified recipient with the text content "This is a simple test message" with the sender "iP.1 Networks AB".

senderName

The name associated with the sender address. Can be anything, max 64 characters.

senderAddress

The sender email address from which the email will be sent. Any valid email address for a registered and verified domain.

recipients

An array of email addresses to send the email to. Requires all email addresses to be valid.

subject

The email subject line. Max 78 characters.

type

The type of email to send that determines how the body parameter is used, descriptions below.

Value (type)Description
TextUnformatted email, the body is the entire email content
HybridPlain text entered into our ready-made HTML template as a text box, the body is the text in the box
HTMLFull HTML email, body when a full HTML page

body

The email content. Plain text or HTML depending on the type used.

Expanded

Some may require additional features such as template, scheduled shipment, delivery reports and being able to enter your own reference.

{ "senderName": "Sample Corp", "senderAddress": "info@example.com", "recipients": { "info@othercorp.com": { "name": "Head Office", "text": " special" }, "billing@othercorp.com": {}, "default": { "name": "Office", "text": "plain" } }, "subject": "Sample Email", "type" : "Text", "body": "This is a sample email in {text} text to {name}", "priority": 1, "deliveryWindows": [ { "opens": "ISO-8601 string", "closes": "ISO-8601 string" }, { "opens": "ISO-8601 string ", "closes": "ISO-8601 string" } ], "deliveryReportUrl": "https://api.example.com/email/deliveryreport", "reference": "A client reference", "tags": [ "marketing", "ux", "design"] }

recipients - templating

In order to use our templating system, you need to convert your previous recipient set to a dictionary of dictionaries. The top level key is the recipient's email address. The second level key is then searched for in the text and then replaced by the second level's value.

If the key name is not included, it will be generated by extracting the user part of the email address. This template value is used as the recipient name associated with that email address.

The default key is used for fallback values for keys that are missing from a receiver. Like the second one in the example.

priority

If it is very important to you that your messages arrive quickly and are not obstructed by our other messages in the queue, you can prioritize higher. However, prioritizing a higher value will increase the price by 10 öre (0.01 EUR). Priority 1 is the default and is the lowest priority available, and priority 2 is the highest priority available. If specified, 1 and 2 are the only valid values.

deliveryWindows

If there is a need to schedule a shipment, it is possible to do so with our delivery time windows.

You can have as many windows as you like. This allows you to send messages at specific times over several days, e.g. every day between 10:00 and 10:05 on weekdays.

Parsing

  • null in the field opens will be replaced with the current date and time.
  • If closes is null the field will be set to 7 days (168 hours after the value in the field opens).

The call will be rejected if there are overlapping windows.

If no window is given, we will create a window that will apply the above rule.

deliveryReportUrl

If provided, status update reports will be sent to this URL via POST. These reports are separate for each message recipient and each status update. For further reading about these reports, see Read delivery reports

reference

This is a feature that allows the user of this API to have their own ID or credential if storing the iP.1's generated ID is not preferred.

Restrictions

  • May be a maximum of 40 characters
  • Cannot be empty string or spaces.

null is default value.

tags

An array of tags used to categorize/sort the email among your other emails. When listing parties, you can filter by these.

Reply

If the call is accepted, the API will return a digest for the email, which can be found later at the location specified by the location header. For more information about the response data type, see the email documentation.

We will return our response before we have received confirmation that your account balance has been confirmed so the price summary may not be set.