Jump to content

How to remove the shop name from the mail subject by override


Recommended Posts


is there anyone who can tell me how to override this code to remove [shop name] from the mail subject?


$subject = '[' . $shop->name . '] ' . $subject;


$subject = $subject;

goal: remove [shop name] from the all mails subject

Thanks for any reply.


Share this post

Link to post
Share on other sites


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:


class Mail extends MailCore
    public static function send(
        $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);
        return parent::send(


Or create custom module and call hook:

public function hookActionEmailSendBefore($param)
    if (!isset($param['subject'])) {

    $shop_name = '['.strip_tags($configuration['PS_SHOP_NAME']).'] ';
    $subject = str_replace($shop_name, '', $param['subject']);
    $param['subject'] = $subject;

There are more options 😉

Edited by 4you.software (see edit history)
  • Like 1
  • Thanks 1

Share this post

Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More