Skip to main content

Automation

ProRequires Events Manager Pro. Compare plans

An automation is a rule in three parts: When something happens, Select what to work with, Then do something. For example: when a booking is approved, take that booking, and send its details to your CRM. Or: two days before an event starts, take the event, and email its organizer.

Events Manager Pro comes with three triggers and two actions, an email and a webhook. The Connect add-on adds actions that send SMS, WhatsApp and Telegram messages.

The feature is labeled Beta in the settings.

VideoAutomation2:51
Before you start
  • Automations that depend on time are run by WordPress's scheduler, which is checked every minute. If WP-Cron doesn't run reliably on your site, set up a real cron job first, or timed automations will be skipped.
  • Email actions use your site's normal sending setup. Check it with the test in Mail Settings.
  • Only administrators can see and edit automations.

Turn automation on​

  1. Go to Events then Settings then General and open Automation.

    Automation is off until you enable it.

  2. Set Enable Automation? to Yes and click Save Changes.

  3. Look in the Events menu, where an Automation item has been added.

Build an automation​

This example sends a webhook each time a booking is approved.

  1. Go to Events then Automation and click Add New.

  2. Type a name in the box at the top, such as Send approved bookings to the CRM. The name is for your reference and is required.

  3. Under When, choose a Trigger. Pick Booking Status Change. In When status changes from, pick the statuses a booking may come from, for example No Status (New Booking) and Pending. In Pro 3.10 an automation with this field left empty is not saved: the editor reloads empty with no message.

  4. Under Select, choose what to hand to the actions. Pick The Booking(s).

  5. Filters for that choice appear. In the first one, keep Include and choose Approved as the booking status. Without this, the automation would run on every status change.

  6. Under Then, choose an Action. Pick Webhook and enter the address that should receive the data in Webhook URL.

    When a booking's status changes, select the booking if it is approved, then send it to a webhook.

  7. Click Test Webhook to send a sample booking to that address. The result appears beside the button, for example Success - Received response code 200.

  8. Click Save Automation.

  9. A new automation is saved inactive. Click Activate in the notice at the top of the page. The notice changes to Your automation is ready and listening for triggers!

To run more than one action from the same trigger, click Add Another Action. Each action has a checkbox in its title bar: untick it to keep the action but skip it. Remove Action deletes it.

Triggers​

A trigger decides when the automation runs.

TriggerRunsOptions
Booking Status ChangeWhen a new booking is made, and each time a booking's status changesWhen status changes from: optionally limit it to bookings that were in one of the statuses you choose. No Status (New Booking) means a booking that has only now been made. Leave it empty for any.
Booking TimeA set time after a booking was madeA number of Minutes, Hours or Days, and Only events that have not started yet.
Event TimesA set time before or after an event's start timeA number of Minutes, Hours or Days, and Before or After.

Booking Status Change runs at the moment of the change, in the same request, so it does not depend on WP-Cron. Use the status filter under Select to say which status the booking must now have. Bookings that are only holding spaces during checkout never trigger an automation.

The two timed triggers are checked once a minute and are covered in Timing below.

New bookings that are paid for

A booking paid online is first created as Awaiting Online Payment and becomes Approved when the payment completes. To act on confirmed bookings however they were made, pick every status a booking can come from in When status changes from (Pro 3.10 doesn't save it empty) and include only the Approved status under Select.

What is passed to the actions​

Each trigger starts from either a booking or an event. Under Select you choose whether the actions receive that item or the one related to it.

Trigger starts fromChoiceActions run
A booking (Booking Status Change, Booking Time)The Booking(s)Once, for the booking
The Event each booking belongs toOnce, for the event the booking is for
An event (Event Times)The EventOnce, for the event
Event BookingsOnce for every booking of the event that passes the filters

The choice matters to the actions. An email about a booking can use booking placeholders and be sent to the person who booked. An email about an event can't.

Filters​

After you choose, optional filters narrow down what is passed on. An item that doesn't pass is skipped and no action runs for it.

FilterAvailable when passingWhat it does
Include or Exclude the following booking statusesBookingsLimits bookings by the status they have when the automation runs.
Include or Exclude the following gatewaysBookingsLimits bookings by the payment gateway they were made with.
Include or Exclude the following categoriesAn eventLimits events by category.
Include or Exclude the following tagsAn eventLimits events by tag.
Include only events with these RSVP PoliciesEitherAll, No Policy, Open, Flexible or Strict. See RSVP.
Event Bookings without a status filter

With Event Times and Event Bookings, an automation with no status filter runs for every booking of the event, including pending, rejected and cancelled ones. When the action emails attendees, include only Approved.

Actions​

Email​

Sends an email. The first menu decides who receives it.

Send toRecipients
EmailsThe address you type in the Emails field.
Event Booking AdminsThe addresses in Email events admin? in Events then Settings then Emails then Booking Email Templates, plus any extra admin recipients set for the event.
Event OwnerThe owner of the event.
RegistrantThe person who made the booking. Only works when the automation passes bookings, not an event.

Then write the Subject and Message. Both accept placeholders:

  • When the automation passes a booking: booking, event and location placeholders, as in the booking emails. The join-link placeholders for online events work here too.
  • When it passes an event: event and location placeholders only.

The email is added to the same queue as event reminders and is sent within a minute or two, from the sender set in Mail Settings.

One address in the Emails field

The hint under the Emails field says to separate several addresses with commas. In Pro 3.10 a list is not split up, and an email to more than one typed address is not sent. Enter a single address, and add another Email action for each further recipient.

Webhook​

Sends the booking or event to another service as JSON, for a CRM, a spreadsheet, a chat channel or an automation service such as Zapier or Make.

DetailValue
MethodPOST
HeaderContent-Type: application/json; charset=utf-8
BodyThe booking or the event, in the same shape as the Events Manager REST API returns it
AuthenticationNone is added. If the receiving service needs a secret, include it in the URL it gives you.
On failureThe request is not repeated.

For a booking, the body has these top-level fields:

FieldHolds
id, uuidThe booking's number and its unique ID
event_idThe ID of the event booked
person_idThe WordPress user ID of the person who booked, or 0 for a guest
statusThe booking status as a number: 0 Pending, 1 Approved, 2 Rejected, 3 Cancelled, 4 Awaiting Online Payment, 5 Awaiting Payment
spaces, price, tax_rate, taxesThe number of spaces and the totals
commentThe comment left with the booking
metaThe booking's extra data, such as the booking form answers and the payment gateway used
ticketsEach ticket booked, with its name, spaces, price and a list of attendees
datetimeWhen the booking was made
eventThe event, with the same fields a webhook receives when the automation passes an event: its name, id, when (dates, times and timezone), location, bookings (spaces booked and available), categories, tags and more
personguest (true or false), email and name of the person who booked, and phone if there is one

Use Test Webhook to see a complete sample in your receiving service.

Test Webhook needs an address that can be reached from the internet. A local or private address is refused with Please enter a valid URL for your webhook. Choose what to pass under Select before testing, so the test knows whether to send a booking or an event.

A webhook on Booking Status Change is sent while the booking is being saved, so a slow receiving service makes that moment slower for whoever is booking or approving.

Messages from Connect​

Pro Plus With Events Manager Connect active, the action list also offers SMS via Twilio, WhatsApp via Twilio, WhatsApp Message and Telegram Message. Their fields and limits are described in Connect: automation actions.

Timing​

Event Times and Booking Time are checked every minute by WP-Cron. Each check looks for events (or bookings) whose moment has arrived within a short window, and acts on those it hasn't acted on before.

Unit you choseWindow
Minutes5 minutes
Hours10 minutes
Days1 hour

In practice:

  • An automation runs once for each event or booking. It won't run a second time for the same one, even if you change the event's date afterwards.
  • If WP-Cron doesn't run at all during the window, that event or booking is missed and is not picked up later.
  • An event created, or moved, to start sooner than the automation's lead time is missed. An automation set to two days before does nothing for an event you add the day before it starts.
  • Times are measured from the event's start. After means after the start time, not after the end.
  • A day is 24 hours. Two days before an event that starts at 7:30 pm means about 7:30 pm two days earlier.

Manage automations​

Events then Automation lists every automation with its Trigger, its Actions and whether it is Active or Inactive.

Each automation shows its trigger, its actions and whether it is active.

  • Hover over a name for Edit, Delete and Activate or Deactivate.
  • Tick several and use the bulk actions menu to delete, activate or deactivate them together.
  • Filter the list by status, by trigger or by action.

Deactivating an automation stops it without losing its setup. An action from an add-on that is no longer active is shown with a warning icon.

More examples​

Email the organizer two days before an event​

PartSetting
TriggerEvent Times: 2, Days, Before the event start time
SelectThe Event
ActionEmail, sent to Event Owner
Subject
#_EVENTNAME is in two days
Message
Hi #_CONTACTNAME,

#_EVENTNAME starts on #_EVENTDATES at #_EVENTTIMES.

#_BOOKEDSPACES of #_SPACES spaces are booked, and #_AVAILABLESPACES are still available.

Remind attendees two hours before​

PartSetting
TriggerEvent Times: 2, Hours, Before the event start time
SelectEvent Bookings, and Include the Approved status
ActionEmail, sent to Registrant

This sits alongside the daily event reminder, which works in whole days.

Follow up a day after someone books​

PartSetting
TriggerBooking Time: 1, Days after the booking was made, with Only events that have not started yet ticked
SelectThe Booking(s), and Include the Approved status
ActionEmail, sent to Registrant

Logs​

Automations have no log screen in Pro 3.10. There are two ways to see what happened, both meant for whoever maintains the site.

Webhook errors. Set Enable Logging? to Yes under Logging in Events then Settings then General then Admin Tools (Advanced). When a webhook can't reach its address, the error is written to a file whose name starts with automation-action-webhook, in the logs folder that setting creates. A webhook that connects but gets an error response from the other service is not logged.

Timed runs. A developer can record each run of the Event Times and Booking Time triggers in a database table by adding a constant to wp-config.php:

wp-config.php
define( 'EM_AUTOMATION_LOGS', 1 ); // 1 records checks that found something to act on, 2 records every check

The table, named em_automation_logs with your database prefix, is created when Events Manager Pro is installed or updated, so add the constant before an update. Booking Status Change runs are not recorded.

Troubleshooting​

There is no Automation item in the Events menu​

Enable Automation? is No, or you are not logged in as an administrator. After saving the setting, reload the page.

The automation never runs​

Check it is Active: a new automation is inactive until you activate it. Then check the filters under Select. A status filter that excludes the booking's current status means nothing happens.

A timed automation was skipped​

WP-Cron didn't run during the window for that event, or the event was created or moved inside the lead time. Set up a real cron job as described in WP-Cron. Timed automations also don't run again for an event they have already handled.

The email action sends nothing​

  • With Emails, enter one address only.
  • Registrant only works when the automation passes bookings. With The Event selected there is nobody to send to.
  • Event Booking Admins is empty when Email events admin? has no addresses and the event has no extra recipients.
  • The subject or message may be the problem if the email arrives empty: booking placeholders print nothing when the automation passes an event.

The webhook isn't received​

Click Test Webhook and read the result. An error there usually means the address is wrong, or your server can't make outgoing connections. If the test works but real ones don't arrive, check the automation is active and its filters match, then switch on logging as described in Logs.

Saving shows an error​

MessageFix
Please enter a name for your automation.Fill in the box at the top.
Please assign a valid trigger to create your automation.Choose a Trigger.
Please select what to output to your actions.Make a choice under Select.
You must create at least one action.Choose an Action under Then.
Please enter a valid URL for your webhook.Enter a full address, including https://.