Email Notification when a New Event is Scheduled #253
-
I am curious about email notifications that would be sent when a new event is scheduled. For example, I am scheduling an event and since I would need technicians to set up workstations with network access, I need the Calendar to send an email notification to the IT Department. Also, I need this for the events already scheduled. I created a mailto: link with subject and body on the template, but that is not sufficient and also kind of lame. I would like the notification to include all event's features, like dates and times that are created with the submission of the form. What would it take to add such a feature? I am a decent PHP programmer, but new to Craft CMS. Craft and Plugin Info:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello @prager I think the easiest option is to setup a custom module in Craft CMS: Within your custom module, you can listen for events. In this case, you would listen for the Calendars I would suggest using Queues/Jobs for performance, so you don't freeze up the Craft CMS Control Panel. Within the job, you then make use of Craft CMS's built in mail service: Non-tested of what it might look like:
|
Beta Was this translation helpful? Give feedback.
Hello @prager
I think the easiest option is to setup a custom module in Craft CMS:
How to Build a Module | Craft CMS Documentation | 4.x
Within your custom module, you can listen for events. In this case, you would listen for the Calendars
SaveElementEvent
event. TheSaveElementEvent
event will contain the Event details and whether it's new or existing.I would suggest using Queues/Jobs for performance, so you don't freeze up the Craft CMS Control Panel.
Within the job, you then make use of Craft CMS's built in mail service:
Queue Jobs | Craft CMS Documentation | 4.x
Email | Craft CMS Documentation | 4.x
Non-tested of what it might look like: