Jump to content

Problem with mail shipped template


i.kris77

Recommended Posts

Hi,

I've got some problem with displaying variables at outgoing mails. Some of variables doesn't show up in final mail, for example {date}.

 

I'm attaching the picture with the effect and code below.

a <table style="font-family: Verdana,sans-serif; font-size: 11px; color: #374953; width: 550px; border-collapse: collapse;" border="0">
<tbody>
<tr>
<td colspan="2"><img style="border: none;" src="{shop_logo}" alt="{shop_name}" /></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" align="left">
<h2>Your order has been sent</h2>
</td>
</tr>
<tr>
<td colspan="2" align="left"><span style="color: #fc6719; font-weight: bold;">{firstname} {lastname}</span>, we would like to inform you that your order was forwarded to the transport company. You can find the number of you package below, so you can track it.</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" align="left">In section <a style="color: #374953; font-weight: bold; text-decoration: none;" href="{my_account_url}">My Account</a> <strong>/ <a style="color: #374953; font-weight: bold; text-decoration: none;" href="{guest_tracking_url}">My Orders</a> / <a style="color: #374953; font-weight: bold; text-decoration: none;" href="{history_url}">History Order</a> </strong>- you can check your order and display the invoice.</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" align="left"><hr /><strong>Order nr <span style="color: #fc6719;">{order_name}</span> from <span style="color: #fc6719;">{date}</span></strong><hr /></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" align="left">Has been sent on <span style="font-weight: bold; font-size: 14px;">{shipping_date}</span><br /> Package number: <span style="font-weight: bold; font-size: 14px;">{shipping_number}</span></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td style="font-size: 10px;" colspan="2" align="center"><hr /><a style="color: #fc6719; font-weight: bold; text-decoration: none;" href="{shop_url}">{shop_name}</a> based on <a style="text-decoration: none; color: #374953;" href="http://www.prestashop.com/">PrestaShop™</a></td>
</tr>
</tbody>
</table>

Could you help me solve this?

post-846727-0-49120200-1428503299_thumb.png

Link to comment
Share on other sites

I figuret that I had to add this code to AdminOrdersController.php :

 

$templateVars = array(
                            '{date}' => $order->date_add,
                            '{shipping_date}' => $order->date_upd,
);

And it worked.

 

BUT

Now when I enter the shipment tracking code in the order (Backend->Orders) somehow it overwrites $templateVars and the problem comes back -> there are no variables in mail, it only looks like this -> {date} or {shipping_number}.

It only works propertly when I do things in specific order, that is:
1. change status to "Sent" (there goes the email to client with right variables)
2. add tracking code (second email to client with right tracking code)
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...