Jump to content

Email variables names not replaced by its values ( only some email accounts )


Recommended Posts

Hi all,

We have developed one new email template, named 'pending_documentation'.

Ok, in this PrestaShop instance, when new order is made, the customer receive one email with this template, due to this order changes itself to this order state: pending_documentation

Everything is ok, and email is arriving well in most of cases, but in some cases emails arrives to the customer with variables names, instead of variables values.

For example:

image.png.43d0f9a5da9fc58c4498c2e82324cc4c.png

Someone can explain to me what's going on?

Summary, we prepare one array named $mail_vars, with all custom variables, like:

$mail_vars = array(
 '{producto_precio}'       => Tools::displayPrice($amount, $currency) . ' /' . $this->module->l('mes'),
 .
 .
 .
);

And then, we use this:

$this->module->validateOrder(
  $cart->id,
  $payment_status,
  $amount,
  $module_name,
  null,
  $mail_vars,
  $currency_id,
  false,
  $secure_key
);

To validate the order, and send the mail with the $mail_vars.

Everything is ok, but I don't understand why it happens.

Thanks you very much in advance.

Edited by garciasanchezdani (see edit history)
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...