For one of our projects we use Calendarize.it, a Calendar plugin for WordPress by RightHere. It is a popular premium calendar plugin available on CodeCanyon. It has very cool features, is extensible and has a very modern user interface supporting AJAX requests for smoothly loading your event data.
But one thing was missing for our project: Email notifications. We needed this because we use the extension “Community Events” which allows our visitor to submit their own events. Each time a user submits a new event we want to receive a mail letting us now there is a new event. It should contain the URL to that event so that we can check it because submitted events get published directly. Another use case would be a notification email about new pending events so that an admin can check them in the backend and publish them.
Now our plugin Post Status Notifier (PSN) comes into play. With its flexibility you can setup custom notification rules for any WordPress Post Type and therefore including the events of Calendarize.it. This blog post shows you how we setup our notification rules to let us notify about Calendarize.it event status changes.
Email notifications for a published event
Let’s start with the obvious use case. We want to receive a mail each time a new event got published.
Head over to Post Status Notifier’s settings pages (Settings / Post Status Notifer) and create a new rule. We call it “A new event got published”. This is the internal name and you can name it whatever you like. Next step is to select the Post Type. As we want to notify about events we have to choose “Events” from the drop-down list.
Next we have to setup “Status before” and “Status after“. This is important as it tells the notification rule when to trigger on a Post status change. We want the rule to trigger whenever an event post changes its status from anything but published to published, as this is the case when an event gets published. Therefor we select “Not published” for “Status before” and “Published” for “Status after”.
Now it’s time to setup the notification text. PSN lets you completely customize your email subject and body text, it even supports HTML mails. Check the screenshot for the texts we entered. To include information about the event PSN allows you to use placeholders like [post_title] for the the title of the post. Check the manual to see the list of all supported placeholders.
The final mandatory part of rule is to select a recipient. Post Status Notifier offers you multiple options for choosing the recipient(s), including the blog admin, post author, all built-in and custom user roles, custom recipients list which can be managed inside PSN or just a comma separated list of custom email addresses. In this example we choose “Blog admin” and a custom email address. You also may set CC and / or BCC recipients.
To keep this example simple, we skip the other options here, like custom FROM or Editor restriction and click the “Add rule” button to save this rule.
Back in the overview page we see our just create notification rule in the list. The check mark in the column “Active” shows us that this rule is active.
Now we can create an example Calendarize.it event and publish it. This email would be the result of this example:
Email notifications for a pending event
With the first rule saved it is now very easy to setup another notification rule for pending events. Just copy the first rule and edit the duplicate. Then change the title, subject and body to whatever you like. The important thing is to change is the status transition this rule should match. Set “Status before” to “Not pending” and “Status after” to “Pending“. This is a screenshot of the notification rule setup for notifying about Calenderize.it pending events.
When a new Calendarize.it events gets submitted, this example rule would generate an email like this:
Conclusion
These two notification rules are just examples for what you can do with Post Status Notifier. If you need email notifications for other use cases, it’s about you to adjust the rule settings. You can create as many rules as you like. Using the email templates feature you can have nicer looking emails by creating HTML emails.
Post Status Notifier will work with any other WordPress event plugin. Calendarize.it by RightHere is just a popular example.
To check out all the features, visit Post Status Notifier’s plugin homepage. You can download the export file of the rules created in this post on Post Status Notifier’s resources page.
I hope this blog could help you. If you have any questions about WordPress notifications write us a comment or user the contact form.