edwinbak Posted April 29, 2010 Share Posted April 29, 2010 Hi There,I have a question about e-mailsubject to.My shop sent the mail correctly but there is a prefix in the subject.The subject contains "{shop_name} Welcome!" for example.How can i remove the {shop_name} from the subject so there is only "Welcome!" in there?Thanks a lot!GrtzEdwin Link to comment Share on other sites More sharing options...
rocky Posted April 29, 2010 Share Posted April 29, 2010 Topic split - please create a separate topic instead of posting on an existing solved topicChange line 93 of classes/Mail.php (in Prestashop v1.2.5) from: $message = new Swift_Message('['.Configuration::get('PS_SHOP_NAME').'] '.((is_array($_LANGMAIL) AND key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject)); to: $message = new Swift_Message(/*'['.Configuration::get('PS_SHOP_NAME').'] '.*/((is_array($_LANGMAIL) AND key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject)); 1 Link to comment Share on other sites More sharing options...
10mall Posted March 15, 2011 Share Posted March 15, 2011 how do you change the "Welcome" in the subject? Link to comment Share on other sites More sharing options...
rocky Posted March 15, 2011 Share Posted March 15, 2011 Edit mails//lang.php Link to comment Share on other sites More sharing options...
10mall Posted March 15, 2011 Share Posted March 15, 2011 pretty sure it was as well, but I changed, and it's not. Link to comment Share on other sites More sharing options...
10mall Posted March 15, 2011 Share Posted March 15, 2011 Your code above got rid of the [store name], but not the "Welcome!" Link to comment Share on other sites More sharing options...
rocky Posted March 15, 2011 Share Posted March 15, 2011 That's right. The code I wrote above is supposed to remove the shop name only from the email subjects. The following part of the code checks whether there is a translation in mails//lang.php for 'Welcome!'. If there is, then it uses it, otherwise it just uses 'Welcome!'. ((is_array($_LANGMAIL) AND key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject) You should have a line like the following in mails//lang.php: $_LANGMAIL['Welcome!'] = 'Bienvenido !'; This is the Spanish translation for 'Welcome!'. Change 'Bienvenido !' to your translation. Link to comment Share on other sites More sharing options...
10mall Posted March 15, 2011 Share Posted March 15, 2011 You want me to change "Bienvenido!" ??? I'm not getting "bienvenido" I'm getting "Welcome!"How does that work? Link to comment Share on other sites More sharing options...
rocky Posted March 15, 2011 Share Posted March 15, 2011 If no such line like that exists in your lang.php, then add it. If you are saying that yours says: $_LANGMAIL['Welcome!'] = 'Welcome!'; then change the second 'Welcome!' to the text you want. Link to comment Share on other sites More sharing options...
prestaslo Posted December 11, 2014 Share Posted December 11, 2014 How can I change mail subject in ps 1.6? Best regards Link to comment Share on other sites More sharing options...
Lin Posted December 11, 2014 Share Posted December 11, 2014 (edited) How can I change mail subject in ps 1.6? Best regards Access from the admin end It is located in: Localization --> Translations Then look for the Email Templates, and find the order confirmation email template. You will need to change both the HTML version and TXT file version. Edited December 12, 2014 by Lin (see edit history) Link to comment Share on other sites More sharing options...
prestaslo Posted December 11, 2014 Share Posted December 11, 2014 It is located here: Localization --> Translations Then look for the Email Templates, and find the order confirmation email template. You will need to change both the HTML version and TXT file version. I don't find there... What I must change in classes --> Mail.php? Link to comment Share on other sites More sharing options...
Lin Posted December 12, 2014 Share Posted December 12, 2014 I don't find there... What I must change in classes --> Mail.php? Ah sorry I wasn't clear. I was referring to the one you access from admin backend. Link to comment Share on other sites More sharing options...
ecommdev Posted December 12, 2014 Share Posted December 12, 2014 Login to BO, , Localization > Translations > Edit, email templates translations from the drop down, choose theme, language and click modify. screenshot, http://gyazo.com/6251e8bfcf3c8f0c41fa296957855b61 Link to comment Share on other sites More sharing options...
prestaslo Posted December 12, 2014 Share Posted December 12, 2014 Login to BO, , Localization > Translations > Edit, email templates translations from the drop down, choose theme, language and click modify. screenshot, http://gyazo.com/6251e8bfcf3c8f0c41fa296957855b61 Thanks, but there is all ok, but in email subject is still [shop name]. In PS 1.5. I changed some lines in Mail.php, can I also in PS 1.6? Link to comment Share on other sites More sharing options...
prestaslo Posted December 16, 2014 Share Posted December 16, 2014 Thanks, but there is all ok, but in email subject is still [shop name]. In PS 1.5. I changed some lines in Mail.php, can I also in PS 1.6? I still don't find this line in Mail.php... In translations there is no [shop name] in email subjects... Link to comment Share on other sites More sharing options...
Andrus Posted May 13, 2015 Share Posted May 13, 2015 What to comment out in prestashop 1.6? Link to comment Share on other sites More sharing options...
midana Posted July 2, 2015 Share Posted July 2, 2015 (edited) What to comment out in prestashop 1.6? It worked for me to replace this: $message = new Swift_Message('['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.$subject); with: $message = new Swift_Message(/*'['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.*/$subject); Edited July 2, 2015 by midana (see edit history) Link to comment Share on other sites More sharing options...
jcuenin Posted January 6, 2016 Share Posted January 6, 2016 (edited) Hello, Thank you for your explanation regarding how to modify the shop name in the subject. I am trying to do it using an override but I am not sure how to proceed, could you help me on that? For now, I created a Mail.php file in Override/Classes/ with the following but it doest not seem to work : <?php class Mail extends MailCore{ public static function Send() { $id_shop = Context::getContext()->shop->id; $subject = Configuration::get('PS_SHOP_NAME', null, null, $id_shop).' :'.$subject; } } Thank you in advance for your answer and have a good day, Julien Edited January 6, 2016 by jcuenin (see edit history) Link to comment Share on other sites More sharing options...
blademcneil Posted August 24, 2017 Share Posted August 24, 2017 Hi, I am using prestashop 1.6.1.16, I tried all the methods in this article, but the lines you are referring to change don't exist in the Mail.php file, maybe they are written another way? Thank you Link to comment Share on other sites More sharing options...
Scully Posted August 24, 2017 Share Posted August 24, 2017 (edited) Search for $subject in classes/Mail.php. $subject = '['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.$subject; Just delete the line and you are done. The welcome mail would then only say: Welcome Or replace it whith: $subject = '['.Configuration::get('PS_SHOP_DOMAIN', null, null, $id_shop).'] '.$subject; which results in [example.com] Welcome Pls report back. Edited August 24, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
blademcneil Posted August 24, 2017 Share Posted August 24, 2017 Thank you Scully, that did the trick Link to comment Share on other sites More sharing options...
Scully Posted August 24, 2017 Share Posted August 24, 2017 You're welcome. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now