I am having a dilemma on how to send a different email content when an order is Shipped based on the Shipping Method chosen.
For example:
If there is Delivery / Pick Up / Shipping as shipping methods then:
If Delivery:
- "Your order is on the road!"
If Pickup:
- "Your order is ready for Pickup!"
If Shipping:
- (Default email template with tracking code)
More details:
I am using the FlatRate shipping method for Pickup orders and the Table Rates as Delivery.
Thanks!
Best Answer
You can create some variables to use in the email template to add some messages based on the shipping method.
Add the variables to the template by creating a plugin for
Magento\Sales\Model\Order\Email\Container\Template
'ssetTemplateVars
method. For example:In the email template: