Fix the Language Transactional Email’s issue in Magento 2
Magento 2Transaction mail are most commonly used in e-commerce domain and the complexity or equivocal in it affects more to business as at the end of the circle, all is correlated to the customer trust. Based on region, the multi-lingual support is provided, but it is easy to integrate it with the web application but, in mails it is difficult.
In this blog, we are putting a light on Magento 2 Danish (Denmark) Language Pack installs transactional Emails issue Fix. It is related to all transactional emails which are set by default in Magento and mostly order related emails have dynamic values.
In General, if we require any additional language in our Magento 2 version, we usually install the language pack from Magento website. With that, when we install Magento2 Language Pack for DK (Danish – Denmark). Once this pack is strongly installed and we continue using it, we may get a notice that some Email Variables did not render properly for sales emails.
You can see in below example similar scenario where some of the dynamic contents are not rendered properly.
To solve this error follow the below mentioned steps:
- Just because this is a general problem with all dynamic variable, check all .csv files available under following path: app\i18n\magentodanmark\da_dk
- Search for space between ‘%’ and ‘variable_name’ in .csv file, (Have a look on below image of csv, you can see example of “% creditmemo_id”)
- Remove that space in between % and variable_name and make it like “%creditmemo_id”.
Note: You need to update this for all .csv variables with space. - Once updated, save the .csv file in UTF-8 mode, to preserve special characters as well.
Once all steps are performed for all .csv files, clear Magento cache and Run below command in order to get those changes available at our require place, those are standard Magento steps to get effect of changes we did.
Connect to SSH or Command Prompt and go to Magento Root Directory structure and enter below commands:
- php bin/magento cache:flush
- php bin/magento setup:upgrade
- php bin/magento setup:static-content:deploy
You can check your fix after executing above commands. Now variables are changed with dynamic values.
Tell us about your project
Hire dedicated Magento developer from the vast and talented pool of resources.