While doing a code in Magento, you might have met with the problem where special characters like ä were not properly displayed.
Today we are going to talk about this problem and it’s solution.
We faced same situation as shown in screen shot.
To resolve this issue, we used grid renderer for subject column.
First you have to create new admin theme for email gird override.
Create Files like this:
1 |
app/design/adminhtml/[VendorName]/[ThemeName]/registration.php |
1 2 3 4 5 6 7 |
<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::THEME, 'adminhtml/[VendorName]/[ThemeName]', __DIR__ ); |
1 2 3 4 5 6 7 |
<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::THEME, 'adminhtml/[VendorName]/[ThemeName]', __DIR__ ); |
1 |
app/design/adminhtml/[VendorName]/[ThemeName]/theme.xml |
1 2 3 4 |
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>[VendorName] [ThemeName]</title> <parent>Magento/backend</parent> </theme> |
Now Override the email grid in our new theme and add renderer in subject like below:
1 |
app/design/adminhtml/Dahlquist/General/Magento_Email/layout/adminhtml_email_template_grid_block.xml |
1 2 3 4 5 6 7 |
<block class="Magento\Backend\Block\Widget\Grid\Column" name="adminhtml.system.email.template.grid.columnSet.subject" as="subject"> <arguments> <argument name="header" xsi:type="string" translate="true">Subject</argument> <argument name="index" xsi:type="string">template_subject</argument> <argument name="renderer" xsi:type="string">[VendorName]\[ModuleName]\Block\Adminhtml\Template\Grid\Renderer\Testing</argument> </arguments> </block> |
In last part, “Testing” is block file name. But, you can use any name of the class and create in your any custom or existing module:
1 |
[VendorName]\[ModuleName]\Block\Adminhtml\Template\Grid\Renderer\Testing |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<?php namespace [VendorName]\[ModuleName]\Block\Adminhtml\Template\Grid\Renderer; class Testing extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer { public function render(\Magento\Framework\DataObject $row) { $result = $row->getTemplateSubject(); $convertString = ''; if (isset($result)) { $convertString = utf8_encode($result); } return __($convertString); } } |
Now You can see in admin side email grid will look like this:
If you want get query string params in controller file,...
Create di.xml and add the below code Magemonkey/Redirect/etc/frontend/di.xml [crayon-62846f17c9ee3890672863/] Create...
You can try below code to change local date to...
Step 1: First you need to add registration.php file in...
Step1 : Override message.js in current theme file on the...