Jump to content
thirty bees forum

BCC for all outgoing emails


wakabayashi

Recommended Posts

If you want, to send a copy of all emails to yourself, you can use this override.

Just change the email address and save the file as Mail.php in override/classes folder. After uploading the file, you should delete the file cache/class_index.php on your server.

``` <?php

if (!defined('PSVERSION_')) exit;

class Mail extends MailCore {

// BCC Function
public static function Send(
    $idLang,
    $template,
    $subject,
    $templateVars,
    $to,
    $toName = null,
    $from = null,
    $fromName = null,
    $fileAttachment = null,
    $modeSmtp = null,
    $templatePath = _PS_MAIL_DIR_,
    $die = false,
    $idShop = null,
    $bcc = null,
    $replyTo = null)
{
    // Make always an array
    if ($bcc && !is_array($bcc)) {
        $bcc = array($bcc);
    }

    // Add BCC email
    $bcc[] = 'your_email@something.com';

    return parent::Send($idLang, $template, $subject, $templateVars, $to, $toName, $from, $fromName, $fileAttachment, $modeSmtp, $templatePath, $die, $idShop, $bcc, $replyTo);
}

} ```

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