Troubleshoot
This section describes the most common problems that customers report and how they can be resolved:
- The email does not show the coupon code
- The related, upsell or cross-sell products are not displayed
- How do I translate an email template?
The email does not show the coupon code
The coupon code is not visible in the email.
Solution:
- Make sure the coupon code is enabled in the email settings of your trigger.
- If there are no available Cart Price Rules in the email settings, make sure that the option Use Auto Generation is checked at least in one rule.
Note
The Use Auto Generation checkbox is available in the Cart Price rules only when you choose the Specific Coupon option at the Coupon field of your Cart Price Rule.
The related, upsell or cross sell products are not displayed
The block with the selected cross-sell, related, or upsell products is not displayed in the email.
The products for the cross-sell block are selected based on the products associated with the customer's orders or shopping cart.
Before using one of the types as the source for cross-sell block, make sure that an appropriate type of product is configured.
Note
In the preview emails, the module shows random products in the cross-sell block.Solution:
Make sure your products have the cross-sell, related, or upsell products:
- Open one of your products in the admin panel in edit mode.
- Scroll down and expand the Related Products, Up-Sells, and Cross-Sells section.
- You'll see products there if you have configured these settings earlier, but if there are no products, you should configure them.
For more information refer to Magento documentation: https://docs.magento.com/m2/ce/user_guide/catalog/settings-advanced-related-products.html. Also you may find interesting to insert our Related Products for Magento 2 in your emails.
How do I translate an email template?
There are several ways to translate emails:
-
Separate email templates per language:
- Create a new email template in the desired language.
- Create a separate trigger per store and for emails using templates in the corresponding language.
-
Use the Magento translation mechanism:
For example, you want to translate the text Shop Now in the Welcome email template. To translate it, copy the source string with this text to the CSV file located in your theme directory. The translation may look as follows:Example
<a href="{{ store.store_url }}">Shop Now</a> <a href="{{ store.store_url }}">Shop Right Now</a>
Or if you want translate the subject:
Example
Hello {{ customer_name }}!, Hola {{ customer_name }}!
Note
If the string you want to translate contains commas, then you should wrap the translation string with the double quotation mark ("). But if the string in addition to comma contains a double quotation mark, then you should replace all double quotes in the original text with the single quotation mark (').
After extension update php code in the templates stopped working
According to the Magento security policies starting with the module-email version 2.1.28 and module-email-designer version 1.1.31 ability to use php code in the templates was disabled.
If this ability is vital for your store, it is possible to revert the function code located at the file vendor/mirasvit/module-email-designer/src/EmailDesigner/Service/TemplateEngine/Php.php
-
Should be modified function
getHtml
with the next code:private function getHtml($tplPath) { ob_start(); include $tplPath; $html = ob_get_clean(); return $html; }
After a Magento or extension update, the event log is empty and emails don't send.
To fix this, open the /app/etc/env.php
file and check if you have the consumers section.
...
'cron_consumers_runner' => [
'cron_run' => false,
'max_messages' => 20000,
'consumers' => [
'consumer1',
'consumer2'
]
],
...
If you have it, you should add our job 'mirasvit.event.mq.register'
to the list. Once added, run the command php -f bin/magento queue:consumers:start mirasvit.event.mq.register
to start it.
Example:
...
'cron_consumers_runner' => [
'cron_run' => false,
'max_messages' => 20000,
'consumers' => [
'product_action_attribute.update',
'inventory.source.items.cleanup',
'mirasvit.event.mq.register'
]
],
...