Wooxy API v.3.0

Send Email

The Send Email method allows you to send emails to any contact and manually select the domain from which to send them.

Request

POST
https://api.wooxy.com/v3/mailer/send

IMPORTANT: Do not send more than 10 concurrent API requests.

Body Example

                                        {
    "from": {
        "email": "user@senderexample.com",
        "name": "Sender Name"
    },
    "to": {
        "email": "user@recipientexample.com",
        "name": "Contact Name"
    },
    "replyTo": {
        "email": "support@senderexample.com",
        "name": "Support"
    },
    "subject": "Hello subject",
    "html": "Hello, World!",
    "text": "Hello, World!",
    "ignoreBlackList": false,
    "tags": [ "mailerApiSend" ], 
    "headers": { "X-Additional-Header": "additional-header-value" }, 
    "priority": 1 
}
                                    

Parameters

Title Type Default Description

from

required
object

An array of sender information.
You can use only domain name verified in your account.

from.email

required
string

The sender email address.

from.name

optional
string from.email

Optional from name to be used.

to

required
object

An array of recipient information.
You can send only one email at a time. If you need to send the same message to two recipients, you must send it twice to the Wooxy API.

to.email

required
string

The email address of the recipient.

to.name

optional
string to.email

The optional display name to use for the recipient.

replyTo

optional
object null

An array of optional reply-to information.
Email address used to compose the email’s Custom “Reply-To” header. If no reply-to address provided “From” will be used instead.

replyTo.email

required
string

The email address of the reply-to recipient.

replyTo.name

optional
string replyTo.email

The optional display name to use for the reply-to recipient.

subject

required
string

The message subject.

html

required
string

The full HTML or text content to be sent.

text

optional
string html

Optional plain text content to be sent. If no text version of the email is provided, Wooxy will generate it from the HTML copy.

ignoreBlackList

optional
boolean false

By setting the filter to true, your message will bypass all unsubscribes and suppressions in all lists. IMPORTANTThat parameter is only available for the Enterprise Plan. Request the parameter activation from the support team via support@wooxy.com:

  • ignoreHard:  By setting the filter to true, your message will bypass the bounce list. 
    The spam report and global unsubscribe lists will be checked and respected.
  • ignoreComplaint: By setting the filter to true, your message will bypass the spam report list. 
    The bounce and global unsubscribe lists will be checked and respected.
  • ignoreUnsubscribe: By setting the filter to true, your message will bypass the global unsubscribe list. 
    The spam report and bounce lists will be checked and respected.

tags

optional
array null

An array of string to tag the message with. Stats are accumulated using tags, though we only store the first 100 we see, so this should not be unique or change frequently. Tags should be 50 characters or less.
You can add custom tags to your messages to get custom reports on specific messages (tag templates, campaigns, different types of emails or audience, etc). 

WARNING: A single tag – must not start with an underscore.

headers

optional
object null

Optional extra headers to add to the message (most headers are allowed). IMPORTANT Headers should start with X-.

priority

optional
integer 1

Add priority parameter to the outgoing emails to avoid delivery delays for important messages due to large promo campaigns in queue.
INFO Defaults:

  • Priority 1 is default value;
  • You can have up to 5 priority levels;
  • Priority level over 5 will be rounded to 5.

Response

                                        {
   "result": true,
   "messageId": "5d914c3dd132d5f45a4e3670"
}
                                    

Parameters

Title Type Description

messageId

string

The message's unique identification number is in the Wooxy system. This ID number allows you to get all the statistics for each message you send.

result

boolean

The sending status of the recipient:

  • true: The message is accepted and queued
  • false: The message is rejected

Method Errors

                                        {
   "result": false,
   "errors": [
      "Error description text"
   ]
}
                                    
Error

“Maximum count of records per transaction is 100, current {n}”

“from field must contain email and name fields”

“email parameter at from field required”

“Invalid RFC2822 email {email}”

“name parameter at from field must be a string”

“to field must contain email and name fields”

“email parameter at to field required”

“Invalid RFC2822 email {email}”

“name parameter at to field must be a string”

“replyTo field must contain email and name fields”

“email parameter at replyTo field required”

“Invalid RFC2822 email {email}”

“name parameter at replyTo field must be a string”

“Argument subject must be a non-empty string”

“Argument html must be a non-empty string”

“Argument text must be a string”

“Argument tags must be an array”

“tag name must be a non-empty string”

“Tags should be 50 characters or less”

“Any tags starting with an underscore are reserved for internal use and will cause errors”

“Argument headers must be an array with header-names as keys and header-values as values”

“header name must be a non-empty string”

“header value must be a non-empty string”

“Argument priority must be an integer”

“Argument priority must be between 1 and 5”

Code Examples

PHP
                $accessToken = "YOUR_API_KEY";
$url         = 'https://api.wooxy.com/v3/mailer/send';

$body        = json_encode([
    'from'     => [
        'email'    => 'user@senderexample.com',
        'name'     => 'Sender name',
    ],
    'to'       => [
        'email'    => 'user@recipientexample.com',
        'name'     => 'Recipient name',
    ],
    'replyTo'  => [
        'email'    => 'support@senderexample.com',
        'name'     => 'Support',
    ],
    'subject'  => 'Hello subject',
    'html'     => 'Hello, World!',
    'text'     => 'Hello, World!',
    'tags'     => [
       'mailerApiSend',
    ],
       'headers'   => [
       'X-Additional-Header' => 'additional-header-value',
    ],
    'priority' => 1,
]);

/**
* Request Example
*/
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_INFILESIZE, null);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
 "Access-Token: $accessToken",
 'Content-Type: application/json',
 'Content-Length: ' . strlen($body),
]);

$result = curl_exec($ch);
if ($result === false) {
   echo 'cURL error:' . curl_error($ch) . PHP_EOL;
} else {
   echo strval($result) . PHP_EOL;
}
curl_close($ch);