MailHawk 1.5.4 has 38 actions and 51 filters, read directly from its source code on Nov 18, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when MailHawk fires an action
add_action( 'mailhawk/bounced', function( $to_address, $msg_id ) {
// Your code runs here.
}, 10, 2 );
// Change a value MailHawk is about to use
add_filter( 'mailhawk/abilities/enabled', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * Message bounced */ do_action( 'mailhawk/bounced', $to_address, $msg_id ); -
/** * This filter is documented in wp-includes/pluggable.php */ do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_error_data ) ); -
/** * Turn MailHawk's abilities off */ apply_filters( 'mailhawk/abilities/enabled', true ); -
/** * The DMARC record the domain has now, from DNS */ apply_filters( 'mailhawk/abilities/existing_dmarc_record', get_dmarc_record( $names['hostname'] ), $names['hostname'] ); -
/** * The SPF record the domain has now, from DNS */ apply_filters( 'mailhawk/abilities/existing_spf_record', get_spf_record( (string) $domain->name ), (string) $domain->name ); -
/** * The longest body to return, in characters */ apply_filters( 'mailhawk/abilities/max_body_length', 50000 ); -
/** * Register another ability for an add-on with * MailHawk\Abilities\Abilities::add_ability() */ do_action( 'mailhawk/abilities/register_abilities' ); -
/** * Register another category for an add-on's abilities with * MailHawk\Abilities\Abilities::add_category() */ do_action( 'mailhawk/abilities/register_categories' ); -
/** * The ends of a domain name that only exist on a private network or in * documentation */ apply_filters( 'mailhawk/abilities/reserved_tlds', [ 'local', 'localhost', 'test', 'invalid', 'example', 'lan', 'internal' ] ); -
/** * The sync of delivery statuses with the MTA could not go on */ do_action( 'mailhawk/delivery_sync_failed', $error, $wait ); -
/** * After the bounces of give-ups were undone */ do_action( 'mailhawk/give_up_repair/done', $result ); -
/** * mailhawk init. */ do_action( 'mailhawk/init' ); -
/** * MailHawk loaded. */ do_action( 'mailhawk/loaded' ); -
/** * Suffixes of two parts that domains are registered under, like co.uk, so * example.co.uk is not taken for a subdomain */ apply_filters( 'mailhawk/second_level_suffixes', [ 'co.uk', 'org.uk', 'me.uk', 'ltd.uk', 'plc.uk', 'net.uk', 'ac.uk', 'gov.uk', 'sch.uk', 'com.au', 'net.au', 'org.au', 'edu.au', 'gov.au', 'id.au', 'asn.au', 'co.nz', 'net.nz', 'org.nz', 'ac.nz', 'govt.nz', 'co.za', 'org.za', 'net.za', 'co.in', 'net.in', 'org.in', 'firm.in', 'gen.in', 'ind.in', 'co.jp', 'ne.jp', 'or.jp', 'ac.jp', 'go.jp', 'co.kr', 'or.kr', 'co.il', 'org.il', 'co.id', 'or.id', '... ); -
/** * A recipient reported an email as spam */ do_action( 'mailhawk/spam_complaint', $to_address, $msg_id, $complaint ); -
/** * Filter the webhook batch interval in seconds */ apply_filters( 'mailhawk/webhook_batch_interval', 15 * MINUTE_IN_SECONDS ); -
/** * Fires after PHPMailer is initialized. */ do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) ); -
/** * Filters the wp_mail() arguments. */ apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) ); -
/** * Filters the default wp_mail() charset. */ apply_filters( 'wp_mail_charset', $charset ); -
/** * Filters the wp_mail() content type. */ apply_filters( 'wp_mail_content_type', $content_type ); -
/** * Filters the email address to send from. */ apply_filters( 'wp_mail_from', $from_email ); -
/** * Filters the name to associate with the "from" email address. */ apply_filters( 'wp_mail_from_name', $from_name ); -
do_action( 'mailhawk_notices' ); -
apply_filters( 'mailhawk/bounce_memory_days', 90 ); -
apply_filters( 'mailhawk/finish_url', mailhawk_admin_page() ); -
apply_filters( 'mailhawk/ms/authenticated_sender_domain', $domain ); -
apply_filters( 'mailhawk/review/max_bounce_rate', 5.0 ); -
apply_filters( 'mailhawk/review/max_complaint_rate', 0.1 ); -
apply_filters( 'mailhawk/spf_include', $matches[0] ); -
{$this->get_filter_prefix()}/db/get_by/{$this->get_object_type()}
filter Copy link Customise this hookapply_filters( "{$this->get_filter_prefix()}/db/get_by/{$this->get_object_type()}", $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $column = %s LIMIT 1;", $row_id ) ) ); -
{$this->get_filter_prefix()}/db/get_column_by/{$this->get_object_type()}
filter Copy link Customise this hookapply_filters( "{$this->get_filter_prefix()}/db/get_column_by/{$this->get_object_type()}", $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $column_where = %s LIMIT 1;", $column_value ) ) ); -
{$this->get_filter_prefix()}/db/get_column/{$this->get_object_type()}
filter Copy link Customise this hookapply_filters( "{$this->get_filter_prefix()}/db/get_column/{$this->get_object_type()}", $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ) ) ); -
apply_filters( "{$this->get_filter_prefix()}/db/get/{$this->get_object_type()}", $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ) ) ); -
{$this->get_filter_prefix()}/db/post_bulk_delete/{$this->get_object_type()}
action Copy link Customise this hookdo_action( "{$this->get_filter_prefix()}/db/post_bulk_delete/{$this->get_object_type()}", $where ); -
{$this->get_filter_prefix()}/db/post_delete/{$this->get_object_type()}
action Copy link Customise this hookdo_action( "{$this->get_filter_prefix()}/db/post_delete/{$this->get_object_type()}", $row_id ); -
{$this->get_filter_prefix()}/db/post_insert/{$this->get_object_type()}
action Copy link Customise this hookdo_action( "{$this->get_filter_prefix()}/db/post_insert/{$this->get_object_type()}", $wpdb_insert_id, $data ); -
{$this->get_filter_prefix()}/db/post_mass_update/{$this->get_object_type()}
action Copy link Customise this hookdo_action( "{$this->get_filter_prefix()}/db/post_mass_update/{$this->get_object_type()}", $data ); -
{$this->get_filter_prefix()}/db/post_update/{$this->get_object_type()}
action Copy link Customise this hookdo_action( "{$this->get_filter_prefix()}/db/post_update/{$this->get_object_type()}", $where ); -
{$this->get_filter_prefix()}/db/pre_bulk_delete/{$this->get_object_type()}
action Copy link Customise this hookdo_action( "{$this->get_filter_prefix()}/db/pre_bulk_delete/{$this->get_object_type()}", $where ); -
{$this->get_filter_prefix()}/db/pre_delete/{$this->get_object_type()}
action Copy link Customise this hookdo_action( "{$this->get_filter_prefix()}/db/pre_delete/{$this->get_object_type()}", $row_id ); -
{$this->get_filter_prefix()}/db/pre_insert/{$this->get_object_type()}
action Copy link Customise this hookdo_action( "{$this->get_filter_prefix()}/db/pre_insert/{$this->get_object_type()}", $data ); -
{$this->get_filter_prefix()}/db/pre_mass_update/{$this->get_object_type()}
action Copy link Customise this hookdo_action( "{$this->get_filter_prefix()}/db/pre_mass_update/{$this->get_object_type()}", $data ); -
{$this->get_filter_prefix()}/db/pre_mass_update/{$this->get_object_type()}
filter Copy link Customise this hookapply_filters( "{$this->get_filter_prefix()}/db/pre_mass_update/{$this->get_object_type()}", $data, $column_formats ); -
{$this->get_filter_prefix()}/db/pre_update/{$this->get_object_type()}
action Copy link Customise this hookdo_action( "{$this->get_filter_prefix()}/db/pre_update/{$this->get_object_type()}", $where, $data ); -
{$this->get_filter_prefix()}/db/pre_update/{$this->get_object_type()}
filter Copy link Customise this hookapply_filters( "{$this->get_filter_prefix()}/db/pre_update/{$this->get_object_type()}", $data, $where ); -
{$this->get_filter_prefix()}/db/query/{$this->get_object_type()}
filter Copy link Customise this hookapply_filters( "{$this->get_filter_prefix()}/db/query/{$this->get_object_type()}", $results, $query_vars ); -
apply_filters( "/db/pre_insert/{$this->get_object_type()}", $data, $column_formats ); -
apply_filters( 'action_scheduler_use_cpu_execution_time', defined( 'PANTHEON_ENVIRONMENT' ) ); -
apply_filters( 'admin_memory_limit', $wp_max_limit ); -
do_action( "mailhawk/{$this->get_installer_name()}/activated" ); -
do_action( "mailhawk/{$this->get_installer_name()}/activating" ); -
do_action( "mailhawk/{$this->get_installer_name()}/deactivated" ); -
do_action( "mailhawk/{$this->get_installer_name()}/deactivating" ); -
apply_filters( "mailhawk/{$this->get_object_type()}/get_as_array", [ 'data' => $this->data ] ); -
do_action( "mailhawk/{$this->get_object_type()}/post_create", $this->get_id(), $data, $this ); -
do_action( "mailhawk/{$this->get_object_type()}/post_update", $this->get_id(), $data, $this ); -
do_action( "mailhawk/{$this->get_object_type()}/pre_create", $data, $this ); -
do_action( "mailhawk/{$this->get_object_type()}/pre_update", $this->get_id(), $data, $this ); -
apply_filters( "mailhawk/{$this->get_object_type()}/setup", $object ); -
do_action( 'mailhawk/activated', $this->get_installer_name() ); -
do_action( 'mailhawk/activating', $this->get_installer_name() ); -
apply_filters( 'mailhawk/assess_risk', $risk, $email_address ); -
do_action( 'mailhawk/deactivated', $this->get_installer_name() ); -
do_action( 'mailhawk/deactivating', $this->get_installer_name() ); -
apply_filters( 'mailhawk/delivery_sync_max_age', 7 * DAY_IN_SECONDS ); -
apply_filters( 'mailhawk/delivery_sync_max_requests', 10 ); -
apply_filters( 'mailhawk/delivery_sync_min_age', 15 * MINUTE_IN_SECONDS ); -
apply_filters( 'mailhawk/delivery_sync_unsupported_ttl', 6 * HOUR_IN_SECONDS ); -
apply_filters( 'mailhawk/get_free_inbox_providers', $providers ); -
apply_filters( 'mailhawk/get_inbox_risk', $risk ?? 0, $email ); -
apply_filters( 'mailhawk/hard_bounce_risk', 3 ); -
apply_filters( 'mailhawk/is_free_email_provider', get_free_inbox_provider_risk( get_email_address_hostname( $email ) ) !== null, $email ); -
apply_filters( 'mailhawk/log_trim_batch_size', 1000 ); -
apply_filters( 'mailhawk/log/bulk_actions', $actions ); -
apply_filters( 'mailhawk/log/columns', $columns ); -
do_action( 'mailhawk/log/custom_column', $email, $column_name ); -
apply_filters( 'mailhawk/log/row_actions', $actions, $email, $column_name ); -
apply_filters( 'mailhawk/log/sortable_columns', $sortable_columns ); -
apply_filters( 'mailhawk/log/views', $v ); -
apply_filters( 'mailhawk/new_contact_grace_days', 30 ); -
apply_filters( 'mailhawk/notice_dismissal_days', in_array( $notice, [ 'review', 'groundhogg' ], true ) ? 0 : 7, $notice ); -
do_action( 'mailhawk/quarantine_notice_failed', $count_quarantined ); -
apply_filters( 'mailhawk/quarantine_retention_days', 30 ); -
apply_filters( 'mailhawk/review/max_failed_rate', 5.0 ); -
apply_filters( 'mailhawk/review/min_sent', 100 ); -
apply_filters( 'mailhawk/risk_factor_cache_seconds', WEEK_IN_SECONDS ); -
do_action( "mailhawk/updater/{$this->get_updater_name()}/{$func}" ); -
do_action( "mailhawk/updater/{$this->get_updater_name()}/finished" ); -
do_action( 'mailhawk/wp_mail/sent', $result, $phpmailer );
Generated from MailHawk's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: