0

i make custom mail template. my template variables are $TemplateParameter=[ 'customerName'=>$getOrderParams['customerName'], 'orderItems'=>$getOrderParams['productinfo'] ];

and my 'html' file code is

{{template config_path="design/email/header_template"}} <!-- pathe of template header-->

<table>
    <tr class="email-intro">
        <td>
            <p class="greeting">{{trans " Hello <b>%customerName</b>," customerName=$customerName|row}}</p>

        </td>
    </tr>
    <tr class="email-information">
        <td>

            <table class="email-items">
                <thead>
                <tr>
                    <th class="item-info">{{trans "Item"}}</th>
                    <th class="item-info">{{trans "Sku"}}</th>
                </tr>
                </thead>
                <tbody>
                    // want to set Items and Sku here
                </tbody>
            </table>
        </td>
    </tr>

</table>

{{template config_path="design/email/footer_template"}}

Can anyone tell me please how set orderItems array set in table body .

I received mail correctly but now want to set content . enter image description here

Plz guide me how set Items and Sku in the mail content ?

0
{{template config_path="design/email/header_template"}} <!-- pathe of template header-->

<table>
    <tr class="email-intro">
        <td>
            <p class="greeting">{{trans " Hello <b>%customerName</b>," customerName=$customerName|row}}</p>

        </td>
    </tr>
    <tr class="email-information">
        <td>

            <table class="email-items">
                <thead>
                <tr>
                    <th class="item-info">{{trans "Item"}}</th>
                    <th class="item-info">{{trans "Sku"}}</th>
                </tr>
                </thead>
                <tbody>
                    {{layout handle="your_layout_file_name" items=$items area="frontend"}}
                </tbody>
            </table>
        </td>
    </tr>

</table>

{{template config_path="design/email/footer_template"}}

/app/code/vendor/module/view/frontend/layout/your_layout_file_name.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Product List" design_abstraction="custom">
    <body>
        <block class="Magento\Framework\View\Element\Template" name="email_name" template="Vendor_Module::email/items.phtml"/>
    </body>
</page>

/app/code/vendor/module/view/frontend/template/email/items.phtml

In items.phtml you can get the data like customer name and order item

  • how can get orderitems in items.phtml file ? – HaFiz Umer Apr 8 at 16:32
  • in this file you can call your clock file and get the data – Rk Rathod Apr 9 at 5:13
  • Actually me data array is not in block file . i make observer Vendor\module\Observer\filename.php in this file i call the mail method and send orderitems array in this file. how can get this array in .phtml file – HaFiz Umer Apr 9 at 5:51
  • send custom email ??? – Rk Rathod Apr 9 at 5:53
  • Yes! check i put mail screenshot in question – HaFiz Umer Apr 9 at 5:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.