Applicable to v0.9.5.0+
To customise email templates check - How to customise calendar event content template in PHP?
In this article -
- Email templates customisation using PHP
- List of templates to customise
- How to customise an email template?
Email templates customisation using PHP
Emails like new booking confirmation, reschedule and cancellation mails to the invitee and admin are customisable by overriding PHP templates. If you do not dabble with code, we recommend using the services of a PHP developer who has good knowledge in WordPress to do the customisations. The developer should copy the original desired templates from the plugin and place it in child theme folder and modify it based on your needs.
List of templates to customise
All email templates can be found in [WP Site root]/wp-content/plugins/wpcal/templates/emails folder.
header.php
footer.php
invitee_booking_new.php
invitee_booking_reschedule.php
invitee_booking_cancellation.php
invitee_booking_reminder.php
admin_booking_new.php
admin_booking_reschedule.php
admin_booking_cancellation.php
How to customise an email template?
Make sure the 'Invitee notification type' option of the event type is set to 'Email'.
For example, in this article we are customising email template of invitee new booking confirmation email.
Locate the plugin's desired email template in wpcal plugin's templates folder. [WP Site root]/wp-content/plugins/wpcal/templates/
in this case the template that we are going to customise is emails/invitee_booking_new.php
Full path to the desired template file is [WP Site root]/wp-content/plugins/wpcal/templates/emails/invitee_booking_new.php
It is highly recommended to place the overriding (customised template) file inside a child theme so that it will not get removed during theme updates.
For more info please check - How to setup WordPress child theme?
In our case, the child theme is twentytwentyone-child
Place the copied file in the child theme by creating a 'wpcal' folder as mentioned below
[WP Site root]/wp-content/themes/twentytwentyone-child/wpcal/emails/invitee_booking_new.php
To verify whether you have successfully overridden the template file, go to WP Admin › WPCal.io › Settings › General
Once your customised template displays in the list, you are all set to do the customisation.
Now you can customise the file [WP Site root]/wp-content/themes/twentytwentyone-child/wpcal/emails/invitee_booking_new.php. We strongly recommend you to do the email customisations in the staging site and once all changes are done and tested, deploy it to the production site.
Please watch out for calendar event content template changes in each WPCal updates and sync the changes in your customised template file. As always do the changes in a staging site and verify it before deploying it to production.