-
Notifications
You must be signed in to change notification settings - Fork 64
Sending Batches
Andrew Theken edited this page Jan 16, 2015
·
8 revisions
The Postmark batch API allows you to send up to 500 messages at a time. To do so, create messages that follow the same names as outlined in the Postmark developer documentation
$message1 = ['To' => "someone@someplace.com",
'Cc' => "someoneelse@someplace.com",
'Subject' => "Message 1",
'TextBody' =>"Some plain text",
'From' => "you@yourdomain.com"];
$message2 = ['To' => "someone@someplace.com",
'Cc' => "someoneelse@someplace.com",
'Subject' => "Message 1",
'HtmlBody' =>"<b>HELLO!</b>",
'From' => "you@yourdomain.com"];
$newClient = new PostmarkClient("server_token");
//Pass the messages as an array to the `sendEmailBatch` function.
$responses = newClient->sendEmailBatch([$message1, $message2]);The Postmark-PHP client can be installed from Packagist.
For additional information about the capabilities of the Postmark API, see Postmark Developers Documentation.