Filters whether a contact’s email address is considered deliverable. Return false to treat a contact as undeliverable — for example, after an external bounce check.
apply_filters( 'groundhogg/contact/is_deliverable', $is_deliverable, $contact );
You will receive the default boolean result as the first argument and the Contact object as the second.
Example
add_filter( 'groundhogg/contact/is_deliverable', 'my_extension_check_deliverability', 10, 2 );
/**
* Mark a contact as undeliverable if flagged by an external bounce service.
*
* @param bool $is_deliverable
* @param \Groundhogg\Contact $contact
*
* @return bool
*/
function my_extension_check_deliverability( $is_deliverable, $contact ) {
if ( ! $is_deliverable ) {
return false;
}
return ! my_extension_has_hard_bounce( $contact->get_email() );
}
Was this helpful?
Let us know if this document answered your question. That’s the only way we can improve.
