Win-back email templates follow the standard WooCommerce template override pattern. The three templates are located in templates/emails/ within the plugin directory.
📌 What This Extension Adds: All three win-back email templates are custom to Subscriptions Pro. They extend WooCommerce email classes for consistent header/footer rendering while adding the win-back specific discount code and reactivation link variables.
Template Files #
| Template File | Purpose | |
|---|---|---|
winback.php | Email 1 | Initial re-engagement; includes first discount code |
winback-miss-you.php | Email 2 | Follow-up without discount; focuses on value reminder |
winback-last-chance.php | Email 3 | Final offer; includes second (higher) discount code |
Overriding Templates #
Copy any template file to your-theme/woocommerce/emails/ to override it. WordPress theme override precedence applies — the theme copy will be used instead of the plugin copy.
Available Template Variables #
All three templates have access to the following variables:
| Variable | Description |
|---|---|
$customer_name | Customer’s first and last name |
$subscription_id | The cancelled subscription post ID |
$reactivation_url | Direct URL to reactivate the subscription |
$discount_code | WooCommerce coupon code (Emails 1 and 3 only) |
$discount_amount | Percentage off (Emails 1 and 3 only) |
$unsubscribe_url | Opt-out URL with secure token |
Unsubscribe URL Format #
Every win-back email must include the opt-out link. The canonical URL format is:
“ https://yoursite.com/winback-unsubscribe/?token={token}
`
The {token} value is a unique, per-campaign token stored in wp_dmsilm_sp_winback_campaigns. This token identifies the specific campaign to opt out of and is not the same as the {discount_code} variable. Use $unsubscribe_url in templates — do not construct the URL manually, as the token generation is handled internally.
Important: The opt-out URL parameter is token
, notdiscount_code. Earlier drafts of this documentation incorrectly used{discount_code}as the URL parameter. The correct format as defined by the plugin's rewrite rule is?token={token}`.
Email Subject Lines #
Default subject lines are defined in the email class and can be filtered using standard WooCommerce email subject filters.
