Jump to content

Edit History

garciasanchezdani

garciasanchezdani

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.

garciasanchezdani

garciasanchezdani

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'), . . . );

$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.

×
×
  • Create New...