Skip to content
Permalink
Browse files

Incorrect email subject and template variable {shop_name}

  • Loading branch information
PierreRambaud committed Nov 22, 2019
1 parent 7311e44 commit 17d6e35071d8f39ea3795020a6a718ec150530ca
Showing with 2 additions and 2 deletions.
  1. +2 −2 classes/Mail.php
@@ -465,7 +465,7 @@ function ($carry, $item) {
);

/* Create mail and attach differents parts */
$subject = '[' . $shop->name . '] ' . $subject;
$subject = '[' . Tools::safeOutput($configuration['PS_SHOP_NAME']) . '] ' . $subject;

This comment has been minimized.

Copy link
@Flower7C3

Flower7C3 Jan 2, 2020

There is problem when shop name contains ampersand sign and some language special character - it is converted to encoded text which is not properly displayed.

$message->setSubject($subject);

$message->setCharset('utf-8');
@@ -505,7 +505,7 @@ function ($carry, $item) {
Context::getContext()->link = new Link();
}

$templateVars['{shop_name}'] = Tools::safeOutput($shop->name);
$templateVars['{shop_name}'] = Tools::safeOutput($configuration['PS_SHOP_NAME']);
$templateVars['{shop_url}'] = Context::getContext()->link->getPageLink(
'index',
true,

1 comment on commit 17d6e35

@JBWModules

This comment has been minimized.

Copy link
Contributor

JBWModules commented on 17d6e35 Dec 16, 2019

Tools::safeOutput is causing issues if shop name contains special chars such as Umlaut in German (äöüß)!

Please sign in to comment.
You can’t perform that action at this time.