As a premium user of YayMail, you can add custom fields dynamically by using the built-in shortcodes on your email editor toolbar.
Why you need to add WooCommerce custom field to the emails
In the admin dashboard, WooCommerce order is a custom post type to record all the information and events related to the placed order. When you create a custom field in the order post, it may not show during the checkout process or in the confirmation emails. Without proper email notifications, your customers will be unsure if they have used the right coupon code or whether the order has been shipped or not.
To keep customers informed about any other event which emails the user, you should add custom field values in their emails.
In the next sections, I’m showing you how to add fields and values that present additional information about the order. The process is really simple and doesn’t require any programming knowledge.
This tutorial is using YayMail Pro – Email Customizer for WooCommerce.
Add shortcode for the used coupon to emails
1, In the email editor, click on the (i) icon to open a categorized list of shortcodes
2, Look for the shortcode name you want to use by using the search box
3, Copy the shortcode and paste it onto the text editor
The shortcode will return the coupon code that has been used in that specific order email, which is SUMMER20 in the above case.
Add flexible checkout fields to emails
Pretty much the same as how to add the coupon shortcode, you can add the checkout fields to the email templates easily. In the next steps, I have used Flexible Checkout Fields to create the custom fields.
1, From the email editor, there’s another place to find the list of shortcodes. Click on Shortcode > choose Order Meta, you will see a list of checkout fields.
Please note that you have to create those custom fields and have orders placed with them first before inserting them into the emails.
2, By clicking on the piece of shortcode, you have inserted this shortcode into the current email heading block.
3, In the real email template, the shortcode will return the value that the customer fills in the custom field. Which is ABCF VAT in this case.
Add shipment tracking info to emails
Before adding shipment tracking information to the processing order/order has been shipped emails, you have to create it in each order.
So go to WooCommerce > Orders > Edit order to add the information. If you are not sure how to do it, please learn more on how to add shipment tracking info using the WooCommerce Shipment Tracking extension.
In order to get the shortcode for shipment tracking info, you can go to YayMail email builder > select a Text block > Shortcode > Order Meta and pick the order meta shortcode. This will automatically insert a shipment tracking table into the customized email template.
Easy peasy, right?
I hope you have found the solution for adding custom fields and other attributes to your transactional email templates in a beautiful manner.
If you have issues with inserting other info into WooCommerce emails, don’t hesitate to let us know.