How to customize the email templates
The extension sends four emails: the customer receipt, the admin notification, the approved notification, and the rejected notification. Each one uses a template you can copy and edit.
Create your own template
- Go to Marketing → Email Templates and press Add New Template.
- In Template, choose the matching default under Mirasvit_Withdrawal, for example Withdrawal Request: Customer Receipt, and press Load Template.
- Edit the subject and content, then save the template.
Apply the template
- Go to Stores → Configuration → Mirasvit → EU Withdrawal Button → Email.
- Select your new template in the matching field: Customer Receipt Template, Admin Notification Template, Approved Notification Template, or Rejected Notification Template.
- Save the configuration.
Available variables
The withdrawal emails expose these variables for use in the template:
increment_id— the request reference, such asWD-00001.order_id— the order number.customer_name— the customer's name.refund_amount— the requested item total.shipping_refund— the shipping amount included in the request.reason— the reason the customer entered, if any.created_at— the date and time the request was submitted.view_url— a link to the request.
Templates can be set per store view, so each storefront can use its own wording and language.
Withdrawal button in the order confirmation email
The extension also adds a short withdrawal notice and the Withdraw from Contract button below the item list of Magento's order confirmation email. This block is not part of a template, so you do not need to edit the order email to show it. It is added when:
- the extension is enabled for the store view of the order;
- the order is eligible for withdrawal and still inside the withdrawal window.
There is no separate setting to hide the button only in the email. To remove it from the order confirmation email while keeping the storefront button, disable the mirasvit_withdrawal_inject_button plugin in the etc/di.xml file of your own custom module. The custom module must load after the extension, so add Mirasvit_Withdrawal to the <sequence> in its etc/module.xml. Add this to etc/di.xml:
<type name="Magento\Sales\Block\Order\Email\Items">
<plugin name="mirasvit_withdrawal_inject_button" disabled="true"/>
</type>
Then run php bin/magento setup:di:compile (in production mode) and clear the cache.