Jump to content

Would like to modify how and when emails are sent


dianepep

Recommended Posts

Is there an option in Admin Panel to specify which emails I want sent out when and to whom? I've read posts from a few years ago but my Admin Panel does not show what those posts indicated. I have two issues I would like to correct. 

1. No emails are being sent when an order is created (its status set to pending). 

2. When the order is paid and status changed to processing, two different emails are sent to the customer and I believe this looks amateur. I would prefer to only send a Confirmation email and not both that and a New Order email. 

If there is no place in Admin Panel to specify this, would I make the changes in order.class.php? I went through that but am having a little difficulty understanding it. 

Thanks ahead of time for any help!

Link to comment
Share on other sites

In CubeCart, an email is sent to the admin(s) when an order gets put at Pending, if the setting in admin, Store Settings, Features tab, Misc section, "Order status for admin email notifications" is set for that. Even though all standard six statuses are listed, the only two functional choices are Pending and Processing.

The Print Order Form gateway allows for a courtesy email be sent to the customer. This is the same email as the Cart: Order Confirmation that gets sent to the customer when the order goes to Processing (via any other gateway).

When the order goes to Processing, two emails are sent -- one to the admin if set that way, and one to the customer. (Digital items get a separate email.) These two emails look almost identical. Close examination shows the first paragraph to be specifically worded for each recipient and the Subject line is different ("New Order" is to the admins).

Link to comment
Share on other sites

21 hours ago, bsmither said:

In CubeCart, an email is sent to the admin(s) when an order gets put at Pending, if the setting in admin, Store Settings, Features tab, Misc section, "Order status for admin email notifications" is set for that. Even though all standard six statuses are listed, the only two functional choices are Pending and Processing.

The Print Order Form gateway allows for a courtesy email be sent to the customer. This is the same email as the Cart: Order Confirmation that gets sent to the customer when the order goes to Processing (via any other gateway).

When the order goes to Processing, two emails are sent -- one to the admin if set that way, and one to the customer. (Digital items get a separate email.) These two emails look almost identical. Close examination shows the first paragraph to be specifically worded for each recipient and the Subject line is different ("New Order" is to the admins).

Thanks for your help. I've changed the 'order status for admin email notification' to notify me and will test it tomorrow. 

Is there somewhere I can choose to not have the "New Order" email sent to the customer, only to me? That way the customer will only get the "Order Confirmation" email.  Is this handled in the Print Order Form gateway you mentioned? If so, can  I access that somewhere? Maybe I'm being a bit too picky but I thought it would be annoying to the customer to get both a "New Order" email and an "Order Confirmation" emaii. 

Link to comment
Share on other sites

In my experience, the "New Order" (as seen on the subject line) is for the admin. The first paragraph says:

Customer Name just placed order number 123456-123456-1234 on Date, Time.

This order can be managed online by following the link below.

[A link to the admin script.]

Are you testing this using a customer that has an email that is the same as the admin's email? Do you have sub-admins where one could have the test customer's email address and have that admin's settings set to receive notifications?

 

Link to comment
Share on other sites

20 hours ago, bsmither said:

In my experience, the "New Order" (as seen on the subject line) is for the admin. The first paragraph says:


Customer Name just placed order number 123456-123456-1234 on Date, Time.

This order can be managed online by following the link below.

[A link to the admin script.]

Are you testing this using a customer that has an email that is the same as the admin's email? Do you have sub-admins where one could have the test customer's email address and have that admin's settings set to receive notifications?

 

No. I'm using my personal email which is different from the store's email. I only have myself as admin. The email sure seems like it should be for the admin only but it's going to my customer also. I tested it again using two different emails and had the same result. 

Link to comment
Share on other sites

So we can stipulate the email in question is the "New Order" (subject line) notice.

In admin, Email Log, the list will show the "New Order ###" line item and the email addresses it was sent to.

Please verify that both the admin and the customer's email address are seen in the To column for that line item.
If both are shown, then we can track down what code is adding the customer's address to the admin's email.

If the customer's address is not shown, then we need think of where the email is coming from.

Viewing the actual email sent to you in your email program, please note if there is the customer's email address also in the To: field. If not, then I think the Mailer could have sent a separate admin email to the customer, and there then should be a separate line item in the Email Log.

Link to comment
Share on other sites

23 hours ago, bsmither said:

So we can stipulate the email in question is the "New Order" (subject line) notice.

In admin, Email Log, the list will show the "New Order ###" line item and the email addresses it was sent to.

Please verify that both the admin and the customer's email address are seen in the To column for that line item.
If both are shown, then we can track down what code is adding the customer's address to the admin's email.

If the customer's address is not shown, then we need think of where the email is coming from.

Viewing the actual email sent to you in your email program, please note if there is the customer's email address also in the To: field. If not, then I think the Mailer could have sent a separate admin email to the customer, and there then should be a separate line item in the Email Log.

Okay, in Admin Email Log there are two entries. One specifies Order Confirmation went to my customers email only. The other specifies New Order went to both my customers email ([email protected]) and my stores email ([email protected]). To reiterate, both my customer's email and my store's email are in the TO field of the New Order email log. 

I followed the code on the link you gave me and added the Code Snippet. I received this message in the System Error Log:

[Unknown (Trace)] /homepages/1/d236694210/htdocs/clickandbuilds/cubecart/AprilsDenShop/includes/extra/snippet_72a41b86017c796b2b1df30b98ac9db6.php:14 - Sending an email: 1) /homepages/1/d236694210/htdocs/clickandbuilds/cubecart/AprilsDenShop/index.php(20): include('/homepages/1/d2...') 2) /homepages/1/d236694210/htdocs/clickandbuilds/cubecart/AprilsDenShop/controllers/controller.index.inc.php(89): Cubecart->loadPage() 3) /homepages/1/d236694210/htdocs/clickandbuilds/cubecart/AprilsDenShop/classes/cubecart.class.php(446): Cubecart->_gateway() 4) /homepages/1/d236694210/htdocs/clickandbuilds/cubecart/AprilsDenShop/classes/cubecart.class.php(2111): include('/homepages/1/d2...') 5) /homepages/1/d236694210/htdocs/clickandbuilds/cubecart/AprilsDenShop/modules/plugins/PayPal_Pro/hooks/class.cubecart.construct.gateway.php(130): Order->orderStatus(2, '200221-223609-5...') 6) /homepages/1/d236694210/htdocs/clickandbuilds/cubecart/AprilsDenShop/classes/order.class.php(502): Mailer->sendEmail('dianepep@comcas...', Array) 7) /homepages/1/d236694210/htdocs/clickandbuilds/cubecart/AprilsDenShop/classes/mailer.class.php(231): include('/homepages/1/d2...')

Link to comment
Share on other sites

Just the one item in the log? On an unmodified order.class.php, line 502:

order.class.php(502): Mailer->sendEmail('dianepep@comcas...

is sending an email to the customer.

Line 517 then sends the Admin:Order Received email, so there should be also a second line item in the System Error Log.

Please verify that these line numbers have the statements as shown:

502: $mailer->sendEmail($this->_order_summary['email'], $content);
517: $admin_mailer->sendEmail($admin_notify, $content);

The variable $admin_notify has any admin's email address (as discussed earlier), plus the store's email address -- in that order. Which agrees with what you are seeing in the To: column of the email log.

Note that line 516 has a hook that can be used, among many things, to add an address to the $admin_notify variable.

In admin, Manage Hooks, observe the list of enabled extensions. Do any of those suggest any sort of adjustments being made to orders or to the Mailer? By clicking on the link that is the plugin name, you get a list of hooks that that plugin uses. You will be looking for a hook designated "class.order.order_status.admin_notify".

Link to comment
Share on other sites

14 hours ago, bsmither said:

Just the one item in the log? On an unmodified order.class.php, line 502:

order.class.php(502): Mailer->sendEmail('dianepep@comcas...

is sending an email to the customer.

Line 517 then sends the Admin:Order Received email, so there should be also a second line item in the System Error Log.

Please verify that these line numbers have the statements as shown:


502: $mailer->sendEmail($this->_order_summary['email'], $content);
517: $admin_mailer->sendEmail($admin_notify, $content);

The variable $admin_notify has any admin's email address (as discussed earlier), plus the store's email address -- in that order. Which agrees with what you are seeing in the To: column of the email log.

Note that line 516 has a hook that can be used, among many things, to add an address to the $admin_notify variable.

In admin, Manage Hooks, observe the list of enabled extensions. Do any of those suggest any sort of adjustments being made to orders or to the Mailer? By clicking on the link that is the plugin name, you get a list of hooks that that plugin uses. You will be looking for a hook designated "class.order.order_status.admin_notify".

Yes just the one item in the error log. Everything else in there was the time errors.  Line numbers 502 and 517 do have the exact statements you have shown in them. 

So $admin_notify has any admin's email address in it along with the stores email address? OMG. I'm so stupid sometimes. I did put my personal email address in under Admin and of course I have checked "Receive Order Notifications". I just checked it. I didn't think I did (blush). If I had chosen another email address to test with I guess I would have not had the confusing results. I'm sorry to have taken up your time on such a stupid mistake and thank you for helping me understand this. 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...