postmark-php
postmark-php copied to clipboard
How to get messageID from sendEmail?
I can successfully send e-mail as in your example:
$sendResult = $client->sendEmail(
"[email protected]",
"[email protected]",
"Hello from Postmark!",
"This is just a friendly 'hello' from your friends at Postmark."
);
But can not figure out how to get messageID from the $sendResult, and not finding any information about it in examples or documenation.
$sendResult becomes object(Postmark\Models\DynamicResponseModel) so can not access it directly.
What is the proper way to extract the result from sendEmail?
Hi @kobbe0,
You can access properties like:
$sendResult->MessageID or $sendResult["MessageID"] $sendResult->ErrorCode or $sendResult["ErrorCode"]
This syntax will work for any of the properties returned in the send email response (To, SubmittedAt, MessageID, ErrorCode, or Message)