Jump to content

Edit History

ps8modules

ps8modules

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

ps8modules

ps8modules

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

ps8modules

ps8modules

./classes/Mail.php

Find function Send().

Comment line:

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

 

Or create module and hook:

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

    $shop_name = '['.Configuration::get('PS_SHOP_NAME').'] ';
    $subject = str_replace($shop_name, '', $param['subject']);
    
    $param['subject'] = $subject;
}

 

ps8modules

ps8modules

./classes/Mail.php

Find function Send().

Comment line:

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

 

ps8modules

ps8modules

./classes/Mail.php

Find function Send().

Comment line:

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

×
×
  • Create New...