Jump to content

Remove annoying [Shop Name] prefix on email subject, version 1.7


Mercader Virtual

Recommended Posts

Hi,

I know this question has been asked several times. I tried different solutions but something weird is going on:
 

I edited Mail.php and managed to strip out the shop name $subject.

// Hard-coded replacement, just in case.
$subject = str_replace("[".Configuration::get('PS_SHOP_NAME')."] ", "", $subject);
$message->setSubject($subject);


I checked the $message object just before swift execution:

$send = $swift->send($message);

The subject appears to be correct (without the shop name),  as expected. But guess what?

Still some emails are arriving with that freaking "[Shop Name]" prefix! Funny enough, not all, that is, some are arriving without the shop name.

I thought it was something related to smarty cache, so I clear the cache. It didn't work :(

Any other ideas? Thanks.

 

Edited by mysticav (see edit history)
Link to comment
Share on other sites

  • 6 months later...
  • 1 year later...

You should replace in line ~460 (file /classes/Mail.php, function send()):

/* Create mail and attach differents parts */
$subject = '[' . Configuration::get('PS_SHOP_NAME', null, null, $idShop) . '] ' . $subject;
$message->setSubject($subject);

to:

/* Create mail and attach differents parts */
$message->setSubject($subject);

Then it should work.

Link to comment
Share on other sites

  • 3 years later...

I found out that it can be more simple. At least for V8.1 and above... Go to your database and select the configuration:

SELECT * FROM ps_configuration WHERE `name` = 'PS_MAIL_SUBJECT_PREFIX';

You will see a value of 1. Change this to 0 and apply changes. Now your title won't show your website inside the brackets.

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