Search Knowledge Base by Keyword
Use the SMS & Email Notifications feature in the WP Activity Log plugin to receive an email or SMS notification when a specific change happens on your WordPress sites and multisite networks. The concept of configuring a SMS and / or email notifications is very simply: configure the criteria and when an event in the activity log matches the criteria the notification is sent.
This document explains how to configure an email and or SMS notification trigger in just two steps.
1. Find the Event ID of the WordPress Change
The WP Activity Log plugin uses a different event ID for the different changes or user actions in WordPress. For example whenever a user logs in, the ID of the event in the WordPress activity log is 1000. Use the search in the list of WordPress activity log alert IDs to find the ID of the change you’d like to be notified about.
In this example we will configure an email and SMS notification for when a user with the Editor role publishes a post. The first thing we need to do is to find the ID of the event that the plugin logs when a user publishes a post. I searched for the term publish in the list of event IDs and can see that it is 2001.
2. Create the Notification Trigger
Now that we know the event ID we just have to create the notification trigger seen in the above screenshot. To create it:
- Click on the Notifications node in the plugin menu,
- Click the Custom Notifications taband click the Add New button.
- Specify a title for the trigger. In our example we are using Editor published content.
- Click the + Add Trigger button.
- Configure the following criterion: EVENT ID IS EQUAL 2001.
Note: if you configure the above trigger only the plugin will send an email whenever a new post is published, though we want to receive a notification when an editor publishes a post, so we have to configure another criterion in the trigger.
- Click the +Add Trigger button to add the second criterion.
- Configure the following: AND USER ROLE IS EQUAL EDITOR.
- Specify the email address(es) and mobile number(s) you’d like to alert and click Add Notification to save the trigger.
More advanced trigger criteria
You can use more trigger types to build more complex criteria. For example you want to be alerted via email or receive a SMS when an editor publishes a post that has the movie custom post type. In such case you can built a trigger such as the below:
ALERT CODE IS EQUAL 2001 AND USER ROLE IS EQUAL EDITOR AND POST TYPE IS EQUAL Movie
You can read more about grouping email notification triggers & using operands in the Getting started guide for WordPress email notifications.