Jump to content

How to add admin as "bcc" of all customers' order status emails ?


Recommended Posts

It did NOT crash and moved to Processing! Will brb after emails have had a chance to get here.

OK!!! I received the admin copy of the customer's order confirmation and the fake customer's acknowledgement of the order.

I didn't get the admin order email, but as many times as I've played with this order that may not be an issue.

I'll start from scratch with another order, but what happened to make it suddenly work? What did I do wrong the first time?

PS: The Order Complete order copies for the customer did arrive.

Link to comment
Share on other sites

Hi bsmither,

Your code snippets are working a treat with the order processing and complete status so big thank you for that.

However, I noticed something not quite right but I don't think it is related to your snippets as I unticked them to test and the following issue remains.

Under the store settings, if I choose "cancelled" as my Order status for admin email notifications, admin does not receive a copy of the cancellation order, only the customer. If I choose Pending, admin receives an email notification so is that a separate issue or related. This is a bug surely ?

S.

 

Link to comment
Share on other sites

I see where I made an assumption. The snippet says that a copy will be BCC'd to the admin(s) for any order status change email sent to the customer.

With the (still somewhat limited) availability of hooks, I used the function that assigned the order's DATA to the template engine.

Since (currently) there is no DATA being assigned to the Order Declined, Failed, and Cancelled statuses, the snippet will not be executed.

We can certainly post an issue in the Github requesting that DATA be made available to be assigned in these statuses.

Link to comment
Share on other sites

  • 5 years later...

And the customer's email, used for your experiments, is not one hooked to your real email used as the From in your store?

Try this: in the snippet "BCC's the admins on all customer emails":

Change:
//$this->_mailer->SMTPDebug = 2;
//$this->_mailer->Debugoutput = 'error_log';

To:
$this->_mailer->SMTPDebug = 4;
$this->_mailer->Debugoutput = 'error_log';

Save.

As an experiment, I created an assistant administrator using a friend's email address, and checked the "Receive order status emails" checkbox.

Have CubeCart clear its internal cache.

(Be sure to have the error_log configured according to:)

https://forums.cubecart.com/topic/51550-how-to-create-the-error-log/

This will have the Mailer write an event sequence to the error log (but not CubeCart's System Error Log).

You should see things like:

[21-Nov-2022 19:33:10 America/Los_Angeles] CLIENT -> SERVER: MAIL FROM:<storeMainAdminName@storeDomain.com>

[21-Nov-2022 19:33:10 America/Los_Angeles] SMTP INBOUND: "250 2.1.0 OK z11-20020aa79e4b000000b0056c0d129edfsm9395132pfq.121 - gsmtp"
[21-Nov-2022 19:33:10 America/Los_Angeles] SERVER -> CLIENT: 250 2.1.0 OK z11-20020aa79e4b000000b0056c0d129edfsm9395132pfq.121 - gsmtp

[21-Nov-2022 19:33:10 America/Los_Angeles] CLIENT -> SERVER: RCPT TO:<customer@example.com>

[21-Nov-2022 19:33:10 America/Los_Angeles] SMTP INBOUND: "250 2.1.5 OK z11-20020aa79e4b000000b0056c0d129edfsm9395132pfq.121 - gsmtp"
[21-Nov-2022 19:33:10 America/Los_Angeles] SERVER -> CLIENT: 250 2.1.5 OK z11-20020aa79e4b000000b0056c0d129edfsm9395132pfq.121 - gsmtp

[21-Nov-2022 19:33:10 America/Los_Angeles] CLIENT -> SERVER: RCPT TO:<asstAdminName@somewhere.com>

[21-Nov-2022 19:33:10 America/Los_Angeles] SMTP INBOUND: "250 2.1.5 OK z11-20020aa79e4b000000b0056c0d129edfsm9395132pfq.121 - gsmtp"
[21-Nov-2022 19:33:10 America/Los_Angeles] SERVER -> CLIENT: 250 2.1.5 OK z11-20020aa79e4b000000b0056c0d129edfsm9395132pfq.121 - gsmtp

[21-Nov-2022 19:33:10 America/Los_Angeles] CLIENT -> SERVER: RCPT TO:<storeMainAdminName@storeDomain.com>

The asstAdminName did receive their copy of the customer's email. The storeMainAdminName did not - I have not yet positively identified the culprit.

Note: I am experimenting with customers who have as an email address the same domain as the store: that is, instead of <[email protected]>, all my customers have <[email protected]>. However, as such, that may pose a problem for me in trying to solve this - a situation that has nothing to do with CubeCart, but with the hosting provider for my domain name (currently, Havenswift).

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...