Jump to content

How to remove Shop name from e-mail subject and e-mail logo attachment on Prestashop 1.6 ?


Andrus

Recommended Posts

Hello


 


Theres a topic of what to comment out on mail.php to remove shop name from e-mail subjects and how, but it is a little different on Prestasthop 1.6. What to comment out there?


 


Also the same problem with e-mail logo attachment, how to remove it from PS 1.6 . There are some topics, but theres actually not written what exactly to comment out and the codes on different versions are different.


 


Thanks


Link to comment
Share on other sites

  • 3 weeks later...

Thank you for the answer! I know how to edit the message. I am wondering how to remove the name of the store and the store logo, are inserted automatically in all messages. I've seen solutions for other versions, but they are not appropriate 1.6. Need to fix the classes-mail.php. but I do not know how to do it correctly.

Link to comment
Share on other sites

Hello Steelstyle. Im the original poster who asked this. Unfortunately nobody answered, but somehow I worked this out myself later.

 

To remove shop name from subject I changed in classes/mail.php

 

line 281 

$subject = '['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.$subject;

 

i changed to

 

$subject = $subject;    

___________________________

To remove logo attachment from e-mail i changed the same file:

 

Lines 305 and 306

 

if (isset($logo))
$template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new Swift_File($logo), null, ImageManager::getMimeTypeByExtension($logo)));
 
I just deleted these two lines.
 
It seems that it did what I needed, but Im not sure is this the best and safest way to do this, so if you decide to try it make a backup from your mail.php :)
 
If anyone has a better solution please let us know :)
  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...

I'm also looking to remove the shop name from the subject line of emails but my classes/mail.php file appears to be different to what is outlined above. I don't have any $subject code in there. The closest thing i have is $message = new Swift_Message('['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.$subject); but when I edit this it just stops sending the email altogether. I'm using version 1.6.0.9. Should I try to replace the mail.php file with the latest version and then change the code? Or could I add the code to the file I already have? Any help would be much appreciated.

 

Stuart

Link to comment
Share on other sites

I'm also looking to remove the shop name from the subject line of emails but my classes/mail.php file appears to be different to what is outlined above. I don't have any $subject code in there. The closest thing i have is $message = new Swift_Message('['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.$subject); but when I edit this it just stops sending the email altogether. I'm using version 1.6.0.9. Should I try to replace the mail.php file with the latest version and then change the code? Or could I add the code to the file I already have? Any help would be much appreciated.

 

Stuart

That is not the rigth line to edit.

 

Look line 281 or somewhere there: $subject = '['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.$subject;  

 

and change it to $subject = $subject;   

Link to comment
Share on other sites

Hi Andrus,

 

Thanks for your really swift reply! Line 281 in my mail.php file looks like this:

$template_vars['{color}'] = Tools::safeOutput(Configuration::get('PS_MAIL_COLOR', null, null, $id_shop));

I have no idea why it's different to those found by others above.

Link to comment
Share on other sites

Ok well sorry Im not an expert on this :) Used prestashop for only 1 month :)

Maybe your version of prestashop is a little different then or maybe you have already changed the file.

 

My thoughts are you should try to search PS_SHOP_NAME  and try to figure out where it is connected to subject somewhere. But like I said, I am not a programmer and just using logic in this case :)

Link to comment
Share on other sites

Thanks for the advice but I've managed to solve this now. It appears that version 1.6.0.9 has different code in the mail.php file to that outlined above. I downloaded the latest version 1.6.0.14, and then used the mail.php file from there. I then edited the new version as suggested above and all is working perfectly! Hope this helps others in the future.

 

Stuart

Link to comment
Share on other sites

  • 2 months later...

Thanks for the advice but I've managed to solve this now. It appears that version 1.6.0.9 has different code in the mail.php file to that outlined above. I downloaded the latest version 1.6.0.14, and then used the mail.php file from there. I then edited the new version as suggested above and all is working perfectly! Hope this helps others in the future.

 

Stuart

 

Stuart, are you saying that the newer version of mail.php is compatible with 16.0.9? Does it still work for you?

Thanks.

Link to comment
Share on other sites

Hi aliaspt,

 

Yes, I've found that it has been compatible and we've certainly had no problems so far and have been up and running for a few weeks now. As always, I would suggest that you back up any files before changing them though and remember that you'll need to edit the new file as above to achieve the desired outcome.

 

Hope it helps!

Link to comment
Share on other sites

  • 1 year later...

Hi to all guys,
I ask for a hand to a pretty serious problem.

I recently passed from version 1.6.1.4 to 1.6.1.12.

As I expected, after the update, the subject of emails I send to my customers, and when I receive them, I submit the full name of the site.

I mean:

Now:
[Store-name] Payment Accepted
[store-name] Pending preparation
[store name] Canceled

I WANT TO LEARN:
Payment Accepted
Ongoing preparation
Canceled

 

 

To do this I opened the Mail.php file, and to the string number 298 I deleted the bit: '['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.

 

from

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

to

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

 

 

Now, BO will no longer receive and send emails. I can no longer send notifications to customers.
I do not get orders or anything else in my inbox.
And in "Advanced Parameters > Email" , the page no longer exists.

In FO, customers can no longer send a message.
And they do not even receive Status Updates and everything that spins in sending / receiving emails.
To restore, and save the savvy, I downloaded the original file by sending it to the server, but nothing settled.

Because? Why has not everything been restored?
Is there a way to fix the store?
How do I edit the email object in 1.6.1.12, without causing damage to the store?

 

Thank you always in advance for everyone.

Hello

Edited by GrandeLupo (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...