For the Groupon-like site that I worked on last year I needed to add a custom email to WooCommerce. This was required to check with the vendor on the availability of the purchased service.
The site sold deals for various services e.g. photographers and limousine hire. When purchasing the service the customer specified a date. As the client site was not connected with the vendor’s calendar we needed to ask the vendor to check their availability.
I found an old (from 2013), but very helpful article about adding a Custom WooCommerce Email. I used this to get a significant portion of the code working.
The easy part is incorporating the code into your theme via an add_filter() call.
The site made heavy use of Advanced Custom Fields to display different information for the various service types. For services that required a booking we used the premium Booking & Appointment Plugin for WooCommerce. The customer would choose a date and the vendor would receive an email asking if they were available on that date. To keep the workflow efficient the email sent to the vendor would include two buttons: “Yes, booking accepted” and “No, date unavailable.”
The email class is:
The email uses the dynamic info sent to it to create the email:
I was quite excited to add this to the project and to have such an efficient and simple workflow for the client and the vendors. Unfortunately other aspects of the site were given priority and the standalone script was never developed as the project was abandoned before being fully launched. It wasn’t difficult to create the custom email and I hope that a future project will give me the opportunity to complete one.