Smart Coupons provide a powerful, “all-in-one” solution for gift cards, store credits, discount coupons, and vouchers, extending the core functionality of WooCommerce coupons.
This doc explains how you can add an image to the auto generated coupon email template using the Smart Coupons plugin. Coupons that are sent using the Smart Coupons plugin can be overridden by simply overriding the email templates.
Note: This is a Developer level doc. If you are unfamiliar with code/templates and are resolving potential conflicts, you may need to hire a developer for assistance.
Steps to add an image to an email via template overriding
↑ Back to top- Navigate to WordPress admin panel. Go to WooCommerce > Settings.
- Click on the Emails tab. You will find all the email templates available.
- For now, let’s try to add an image to the ‘Smart Coupons – Auto generated coupon email’ email template. Click on the ‘Manage’ button.
- You can change the subject and email headings as you like, if needed. Click on the ‘Copy file to theme’ button.
- Connect to your hosting environment either using FTP or CPanel. Navigate to the directory
wp-content/themes/{your-theme}/woocommerce/email.php
file. Add an<img>
tag and source of the image, as shown in the screenshot below. - Once you have added the code, you can test this by navigating to the ‘Marketing > Coupons > Bulk Generate’ tab.
- Add the ‘Number of coupons to generate’ as 1. Select ‘Email to recipients’. In ‘Send to’, add your email address.
- Click on the “Preview Email” button to see a preview of the image on the email template, or you can select a discount type and amount and hit the Apply button.
- You will receive an email as to how the image looks on your ‘Coupon email’ template.
Thats it.
The copied file will now override the WooCommerce Smart Coupons default template files.
You can follow this same method for these email templates of the Smart Coupons plugin:
combined-email.php
– This email template is used when the setting under WooCommerce > Settings > Smart Coupons > Combine emails is enabled.acknowledgement-email.php
– This email template is used when an email is sent from the store to the purchaser of the coupon who has sent some coupons to someone else to acknowledge the purchaser of the coupons.
Tips:
To know more about overriding email templates and coupon designs, the following docs can help:
1. How to override email templates.
2. How to override coupon designs.