POST method to send an Email through the API with your account.
Shipments will be sent instantly or scheduled according to the parameters added to the request. You have to provide your MASTER secret in the Authorization header
Name | Description |
---|---|
account_id required | Your account unique identifier to access the API. This parameter is part of the authorization process |
sender required | Parameter containing the name of who sent the message. |
sender_email required | Parameter containing the email of who sent the message. |
subject_holder required | Parameter containing the subject of the message. This message can have interpolation's containers inserted as %{name_of_variable}. Example: "Hi, good morning %{name}". |
message_holder required | Parameter containing the content of the message. This message can have interpolation's containers inserted as %{name_of_variable}. Example: "Hi, good morning %{name}". |
deliveries required | Parameter containing an array of hashes. those hashes contains two key-value elements, email and replacements. The email value contains the destination of the email. The replacements contains a hash with the values of the interpolation's containers. Example: [{ email: "johndoe@example.es", replacements: {"name": "John"} }] |
start_now required | Parameter to schedule the deliveries with the date provided with the parameter start_at |
start_at | Time when to send the email |
POST
/v2/account/:account_id/email/deliveries
Accept: application/json
Authorization: Token token={account.master_secret}
Content-Type: application/json
{
"sender": "John Doe",
"sender_email": "johndoe@example.com",
"subject_holder": "Hello %{name}",
"message_holder": "<html><h1>Hey! This is a test %{name} %{surname}</h1></html>",
"start_now": true,
"deliveries": [
{
"email": "janedoe@example.com",
"replacements": {
"name": "Jane",
"surname": "Doe"
}
}
]
}
200
{
"deliveries": [
{
"valid": true,
"delivery_id": "550ab6a1a096734ce5000002"
}
]
}