Skip to content

WordPress Automations

Send an Email When Any WordPress Hook Fires

Zapify has dedicated triggers for the common events, but WordPress and its plugins fire thousands of hooks. The A WordPress hook fires trigger lets you react to any of them, and the Send an email action tells you when it happens. Both are free.

For the full reference to this trigger, see Utilities.

What this automation does

The automation is one trigger plus one action:

  • Trigger: A WordPress hook fires (UTIL_CUSTOM_HOOK, Utilities)
  • Action: Send an email (WP_SEND_EMAIL, WordPress)

Whenever the hook you name fires, Zapify captures the values it passed and includes them in the email.

Before you start

  • Know the exact hook name, for example woocommerce_order_status_completed. Plugin documentation usually lists them.
  • Both the trigger and the action are free.

Very early hooks can't be caught

Hooks that fire before plugins_loaded — such as muplugins_loaded — have already run by the time Zapify starts, so a trigger on one never fires and shows no error.

How to build the automation

Step 1: Create a new automation

  1. In the WordPress admin, go to Zapify → Automations.
  2. Click Add New to open the builder.
  3. Name it clearly, such as Alert on custom hook.

Create a new automation

Step 2: Add the "A WordPress hook fires" trigger

  1. Click Add Trigger.

Add a trigger

  1. Choose Utilities as the app.

Select Utilities as the trigger

  1. Select A WordPress hook fires.
  2. Fill in the fields:
Field Required What it does
Hook name Yes The name passed to do_action().
Arguments to capture No How many values the hook passes. Defaults to 1.
Priority No Raise it to run after other plugins finish writing their data. Defaults to 10.

If you don't know how many arguments the hook passes, press Listen, make the hook fire (visit the page or submit the form), and Zapify shows what it captured.

Listen for a hook

Step 3: Add the "Send an email" action

  1. Click Add Action.

Add an action

  1. Choose WordPress as the app.

Select WordPress as the action

  1. Select Send an email.

Select Send an email

Step 4: Configure the email

For example:

  • To: dev@example.com
  • Subject: Hook fired: {{trigger:HOOK_NAME}}
  • Body: insert the Argument 1 token to include the first value the hook passed.

Complete the Send an Email Action

Step 5: Set the steps Live and save

  1. Set both the trigger and the action to Live.
  2. Click Save.

Set the automation live

Tokens you can use

Token What it holds
Hook name The hook that fired.
Argument 1, 2, 3… One per captured argument, in order.

If an argument is an array or object, Zapify also exposes a token per property inside it.

How to test it

  1. Make the hook fire — visit the page or perform the action that triggers it.
  2. Check the recipient inbox.
  3. If nothing arrives, open Zapify → Logs, and re-check the hook name for typos.

Conclusion

With the A WordPress hook fires trigger and the Send an email action, Zapify can react to events it has no dedicated trigger for. Next, read the full Utilities reference, or write values to the run log while debugging.

FAQs

How do I find a hook's name?

Check the plugin's developer documentation, or search its source for do_action(.

Is this feature free?

Yes. Both the trigger and the action are free.

Do I need to write any code?

No — you only need to know the hook name.

Was this page helpful?