Jump to content

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


garciasanchezdani

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

Link to comment
Share on other sites

  • 4 months later...

OMG. Just changed one of my test accounts to a mixed case, and BAM, the problem occurred! Fantastic find. I'll go and fix my customer accounts. By any chance do you know if a bug has already been raised for this issue?

Thanks for the reply!

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