Skip to main content
edited title
Source Link
Alin Lupoiu
  • 2.7k
  • 5
  • 41
  • 76

Get custom HTML variable from email template

I had this issue:

I have created a custom mail where I send a list of products. For this in my controller i concatenated a variable like this:

foreach (.....){
    $orderItems .= "<tr>
      <td>
        <p>" . $productSku . "</p>
        <p>" .  $differanceQty . "</p>                         
      </td>
    </tr>";
}

When I tried to send this variable from my controller to the email template in my email I received the HTML code instead of only the value. So my custom email doesn't interpret my variable in the right way.

So I started looking for an answer and I didn't find anything related to this issue so that's why I posted this, maybe this will help someone.

the solution is to use the variable like this in the mail :

{{var order}} insead of {{htmlescape var=$order}}

Get custom variable from email template

I had this issue:

I have created a custom mail where I send a list of products. For this in my controller i concatenated a variable like this:

$orderItems .= "<tr>
  <td>
    <p>" . $productSku . "</p>
    <p>" .  $differanceQty . "</p>                         
  </td>
</tr>";

When I tried to send this variable from my controller to the email template in my email I received the HTML code instead of only the value. So my custom email doesn't interpret my variable in the right way.

So I started looking for an answer and I didn't find anything related to this issue so that's why I posted this, maybe this will help someone.

the solution is to use the variable like this in the mail :

{{var order}} insead of {{htmlescape var=$order}}

Get custom HTML variable from email template

I had this issue:

I have created a custom mail where I send a list of products. For this in my controller i concatenated a variable like this:

foreach (.....){
    $orderItems .= "<tr>
      <td>
        <p>" . $productSku . "</p>
        <p>" .  $differanceQty . "</p>                         
      </td>
    </tr>";
}

When I tried to send this variable from my controller to the email template in my email I received the HTML code instead of only the value. So my custom email doesn't interpret my variable in the right way.

So I started looking for an answer and I didn't find anything related to this issue so that's why I posted this, maybe this will help someone.

the solution is to use the variable like this in the mail :

{{var order}} insead of {{htmlescape var=$order}}

deleted 31 characters in body; edited title
Source Link
Kishan Patadia
  • 5.6k
  • 3
  • 25
  • 36

Get custom variable from email template.

I had this issue:

I have created a custom mail where I send a list of products. For this in my controller i concatenated a variable like this:

  $orderItems .= "<tr>
         <td>
           <p>" . $productSku . "</p>
           <p>" .  $differanceQty . "</p>                         
      </td>
    </tr>";

When I tried to send this variable from my controller to the email template in my email I received the HTML code instead of only the value. So my custom email doesn't interpret my variable in the right way.

So I started looking for an answer and I didn't find anything related to this issue so that's why I posted this, maybe this will help someone.

the solution is to use the variable like this in the mail :

{{var order}} insead of {{htmlescape var=$order}}

Get custom variable from email template.

I had this issue:

I have created a custom mail where I send a list of products. For this in my controller i concatenated a variable like this:

  $orderItems .= "<tr>
         <td>
           <p>" . $productSku . "</p>
           <p>" .  $differanceQty . "</p>                         
      </td>
    </tr>";

When I tried to send this variable from my controller to the email template in my email I received the HTML code instead of only the value. So my custom email doesn't interpret my variable in the right way.

So I started looking for an answer and I didn't find anything related to this issue so that's why I posted this, maybe this will help someone.

the solution is to use the variable like this in the mail :

{{var order}} insead of {{htmlescape var=$order}}

Get custom variable from email template

I had this issue:

I have created a custom mail where I send a list of products. For this in my controller i concatenated a variable like this:

$orderItems .= "<tr>
  <td>
    <p>" . $productSku . "</p>
    <p>" .  $differanceQty . "</p>                         
  </td>
</tr>";

When I tried to send this variable from my controller to the email template in my email I received the HTML code instead of only the value. So my custom email doesn't interpret my variable in the right way.

So I started looking for an answer and I didn't find anything related to this issue so that's why I posted this, maybe this will help someone.

the solution is to use the variable like this in the mail :

{{var order}} insead of {{htmlescape var=$order}}

Correct bad spelling and some grammar and some clarification in headline on the specific issue.
Source Link

Magento decode html variabile in Get custom variable from email template.

I had this issue:

I have created a custom mail where I send a list of products. For this in my controller i concatenated a variabilevariable like this:

  $orderItems .= "<tr>
         <td>
           <p>" . $productSku . "</p>
           <p>" .  $differanceQty . "</p>                         
      </td>
    </tr>";

When iI tried to send this variabilevariable from my controller to the email templateintemplate in my email i receiveI received the htmlHTML code instead of only the value from data. So my custom email doesen't interpretatedoesn't interpret my variabilevariable in the righright way.

So iI started looking for an answer and iI didn't find anything realedrelated to this issue so that's why iI posted this, maybe this will help someone.

the solution is to use the variable like this in the mail :

{{var order}} insead of {{htmlescape var=$order}}

Magento decode html variabile in email template

I had this issue:

I have created a custom mail where I send a list of products. For this in my controller i concatenated a variabile like this:

  $orderItems .= "<tr>
         <td>
           <p>" . $productSku . "</p>
           <p>" .  $differanceQty . "</p>                         
      </td>
    </tr>";

When i tried to send this variabile from controller to the email templatein my email i receive the html code instead of only the value from data. So my custom email doesen't interpretate my variabile in the righ way.

So i started looking for an answer and i didn't find anything realed to this issue so that's why i posted this, maybe this will help someone.

the solution is to use the variable like this in the mail :

{{var order}} insead of {{htmlescape var=$order}}

Get custom variable from email template.

I had this issue:

I have created a custom mail where I send a list of products. For this in my controller i concatenated a variable like this:

  $orderItems .= "<tr>
         <td>
           <p>" . $productSku . "</p>
           <p>" .  $differanceQty . "</p>                         
      </td>
    </tr>";

When I tried to send this variable from my controller to the email template in my email I received the HTML code instead of only the value. So my custom email doesn't interpret my variable in the right way.

So I started looking for an answer and I didn't find anything related to this issue so that's why I posted this, maybe this will help someone.

the solution is to use the variable like this in the mail :

{{var order}} insead of {{htmlescape var=$order}}

Source Link
Alin Lupoiu
  • 2.7k
  • 5
  • 41
  • 76
Loading