Jump to content

BCC All Outgoing Email Messages


csimmons222

Recommended Posts

I have currently defined the SMTP information within the BO for outgoing email messages and it is working as intended.  However, I want to BCC all outgoing email messages and I have having some problems doing so.  I have gone into the mail.php file and added:

public static function Send($id_lang, $template, $subject, $template_vars, $to,
        $to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null,
        $template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null, $bcc = null, $reply_to = null)
    {
		/* Site Administrator added the following code to bcc all emails */
		$bcc = '[email protected]';
		/* End of Edit */

This does BCC all outgoing messages as I would like but it seems to cause all email messages to be sent twice.  In other words, the customer receives two of the same order confirmation emails.  If a customer contacts me through the contact form, they receive two identical messages stating that there comment has been submitted.  Etc, Etc.  

 

If I removed the $bcc = '[email protected]'; that I added and test then emails are only sent once as they should be.  Obviously, I am doing something wrong here.  

 

Can anyone help me out on how I can set it up so that all messages are BCC to an email address that I specify?  I am using version 1.6.1.6

Edited by csimmons222 (see edit history)
Link to comment
Share on other sites

That swift.php file that is referenced in that post does not exist in v1.6.1.6.

 

I'm doing something similar by overriding the MailCore class (http://doc.prestashop.com/display/PS16/Overriding+default+behaviors) in 1.6.1.5, and it works 100% correctly. However, the basic effect should be the same for your method. You may want to run a debugger on the code to see what is happening. If you're changing core files, maybe some other change you did is effecting this?

Link to comment
Share on other sites

I'm doing something similar by overriding the MailCore class (http://doc.prestashop.com/display/PS16/Overriding+default+behaviors) in 1.6.1.5, and it works 100% correctly. However, the basic effect should be the same for your method. You may want to run a debugger on the code to see what is happening. If you're changing core files, maybe some other change you did is effecting this?

 

Will you tell me what code you added an where to achieve this?

Link to comment
Share on other sites

  • 4 months later...

I'm doing something similar by overriding the MailCore class (http://doc.prestashop.com/display/PS16/Overriding+default+behaviors) in 1.6.1.5, and it works 100% correctly. However, the basic effect should be the same for your method. You may want to run a debugger on the code to see what is happening. If you're changing core files, maybe some other change you did is effecting this?

 

Would you tell me what code you added and where to achieve this?

Link to comment
Share on other sites

  • 3 months later...

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