Don't miss out: Claim a free 90-minute CRM Success Workshop now

Knowledge Base

Browse our knowledge base articles to quickly solve your issue.

Knowledgebase articles

Sending email via the API

With the Workbooks Process Engine it’s easy to send an email.

The API accepts emails in the standard email format. To send an email, pass the complete email content in the ‘rfc822’ parameter, set ‘status=SEND’, and call the Create Email API.

This approach gives you a lot of flexibility. You can send virtually any email format, including attachments. Emails created through the API are also linked to the relevant records in Workbooks, just as they are when sent through the application.

The email is delivered according to your Workbooks Email Configuration.

To send the email you simply need code in your Workbooks Script like this:

$create_email = array (
        'rfc822'   => "From: sender@mydomain.com\n" .
                      "To: recipient@otherdomain.com\n" .
                      "Subject: Hello Email World!\n" .
                      "Content-Type: text/plain; charset=iso-8859-1\n" .
                      "\n" .
                      "Here is the text body of the email.\n",
        'status'   => 'SEND',
);
$workbooks->assertCreate('email/emails', $create_email);
Was this content useful?