-
Notifications
You must be signed in to change notification settings - Fork 17
Home
Andrew Theken edited this page Apr 5, 2018
·
3 revisions
With the postmark-wordpress plugin, it's possible to listen for, and handle errors and successes during sending. You can register for two types of events using the following snippets:
//define a callback for the result of a send to wp_mail.
function postmark_send_callback($response, $headers) {
//handle the response from the wp_mail request.
}
//register this the callback
$priority = 10;
$callback_args_count = 2;
add_action('postmark_response', 'postmark_send_callback', $priority, $callback_args_count);
//define an callback when for when wp_mail produces an error.
function postmark_error_callback($response, $headers) {
//handle the response from the wp_mail request.
}
//register the callback
$priority = 10;
$callback_args_count = 2;
add_action('postmark_error', 'postmark_error_callback', $priority, $callback_args_count);