ballashop Posted January 31 Posted January 31 Hi, is there anyone who can tell me how to override this code to remove [shop name] from the mail subject? from: $subject = '[' . $shop->name . '] ' . $subject; to: $subject = $subject; goal: remove [shop name] from the all mails subject Thanks for any reply. balla Share this post Link to post Share on other sites More sharing options...
Nickz Posted January 31 Posted January 31 Theme, Version, File all not found on my crystal ball. Share this post Link to post Share on other sites More sharing options...
ballashop Posted January 31 Posted January 31 1 hour ago, Nickz said: Theme, Version, File all not found on my crystal ball. @Nickz 😅 PS version: 1.7.6.9 Theme: theme bought on the market Thanks and sorry. Balla Share this post Link to post Share on other sites More sharing options...
4you.software Posted February 1 Posted February 1 (edited) ./classes/Mail.php Find function Send(). Comment line /* xxx */: /* $subject = '[' . Configuration::get('PS_SHOP_NAME', null, null, $idShop) . '] ' . $subject; */ Or create override Mail.php and save to ./override/classes/Mail.php: <?php class Mail extends MailCore { public static function send( $idLang, $template, $subject, $templateVars, $to, $toName = null, $from = null, $fromName = null, $fileAttachment = null, $mode_smtp = null, $templatePath = _PS_MAIL_DIR_, $die = false, $idShop = null, $bcc = null, $replyTo = null, $replyToName = null ) { $shop_name = '[' . strip_tags($configuration['PS_SHOP_NAME']) . '] '; $subject = str_replace($shop_name, '', $subject); $message->setSubject($subject); return parent::send( $idLang, $template, $subject, $templateVars, $to, $toName, $from, $fromName, $fileAttachment, $mode_smtp, $templatePath, $die, $idShop, $bcc, $replyTo, $replyToName ); } } Or create custom module and call hook: public function hookActionEmailSendBefore($param) { if (!isset($param['subject'])) { return; } $shop_name = '['.strip_tags($configuration['PS_SHOP_NAME']).'] '; $subject = str_replace($shop_name, '', $param['subject']); $param['subject'] = $subject; } There are more options 😉 Edited February 1 by 4you.software (see edit history) 1 1 Share this post Link to post Share on other sites More sharing options...
ballashop Posted February 7 Posted February 7 @4you.software thanks a lot. I'll try the override one asap. Do you know if the native newsletter module sends the registration notification to the administrator site? Thanks a lot. Balla Share this post Link to post 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