Zen Cart Logo
Forums / Managing Customers and Orders / Problem & solution to additional customer status emails without customer info

Problem & solution to additional customer status emails without customer info

Views: 1,537

Results 1 to 9 of 9
8 Jul 2013, 9:18 PM
#1
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Problem & solution to additional customer status emails without customer info

If you have a cart where the customer is required to have some sort of approval to browse, view prices or purchase, then when the customer status is updated a generic email goes out that says, "Hey you, your status has been updated." The email has no information in it about who the email is about.

This is the fix for that - uploaded as a mod entitled "Customer Status Update Additional Emails" (just uploaded today) and the instructions here as well since it actually is very simple.

Change the admin file - customers.php

Find around line 79:


```if ((int)CUSTOMERS_APPROVAL_AUTHORIZATION > 0 && (int)$_POST['current'] > 0 && $custinfo->RecordCount() > 0) {         \[/PHP]
 
replace this:
```php
$message = EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE;
              $html_msg['EMAIL_MESSAGE_HTML'] = EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE ;
              zen_mail($custinfo->fields['customers_firstname'] . ' ' . $custinfo->fields['customers_lastname'], $custinfo->fields['customers_email_address'], 

EMAIL_CUSTOMER_STATUS_CHANGE_SUBJECT , $message, $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'default');

with

if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
      $extra_info=email_collect_extra_info('','', $this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], $this->customer

['telephone']);
      $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
			  }
				
              $message = EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE;
              $html_msg['EMAIL_MESSAGE_HTML'] = EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE ;
              zen_mail($custinfo->fields['customers_firstname'] . ' ' . $custinfo->fields['customers_lastname'], $custinfo->fields['customers_email_address'], 

EMAIL_CUSTOMER_STATUS_CHANGE_SUBJECT , $message, $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'default'); 
8 Jul 2013, 10:12 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Problem & solution to additional customer status emails without customer info

Judging only from your post, I'm a bit confused: All it looks like is you're adding the office-use-only section to an email that's being sent out to the customer?

8 Jul 2013, 10:38 PM
#3
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Problem & solution to additional customer status emails without customer info

No, not to the customer. If you have additional emails turned on, the status update also goes out to whoever has been designated to receive the additional emails - I guess the create account emails. So the website owner wanted to know who the emails were going to. I gather he's not doing the approvals himself.

9 Jul 2013, 1:17 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Problem & solution to additional customer status emails without customer info

But ... the code you posted is for the emails going to the customer, not the storeowner or "additional emails to" address:```
zen_mail($custinfo->fields['customers_firstname'] . ' ' . $custinfo->fields['customers_lastname'], $custinfo->fields['customers_email_address'],

9 Jul 2013, 1:24 AM
#5
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Problem & solution to additional customer status emails without customer info

Um, okay so I did get two emails but both were to me. One did come with the extra info and one didn't. But the extra info is listed up above as for the additional emails. That did go also to someone else - a real admin so I'll check to see if he got it. I got the impression that he did.

9 Jul 2013, 2:43 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Problem & solution to additional customer status emails without customer info

No worries. Not nitpicking.
Just wasn't sure about the ultimate intent since the code didn't look like it matched your description. :)

10 Jul 2013, 1:03 PM
#7
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Problem & solution to additional customer status emails without customer info

Well, it's worse than that. I hope y'all didn't approve the mod. I definitely did get it to send out the emails but when the client went back in, it didn't work. He got a blank page when approving a customer. Error message:

[09-Jul-2013 20:19:56] PHP Fatal error:  Using $this when not in object context in /home3/structx1/public_html/zenmin/customers.php on line 81

which is this line

if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
      $extra_info=email_collect_extra_info('','', $this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], $this->customer['telephone']);

I pulled that directly out of the orders class in the catalog where it adds the extra info in the footer of the email.

So step one was incorrect. Immediately realized wrong query - not customer but cust_info in admin so changed to:

if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
      $extra_info=email_collect_extra_info('','', $custinfo->fields['customers_firstname'] . ' ' . $custinfo->fields['customers_lastname'], $custinfo->fields['customers_email_address'], $custinfo->fields['customer_telephone']);
      $html_msg['EXTRA_INFO'] = $extra_info['HTML'];

The info does show up on the admin's email now and I'm sure of that. So I can redo the mod. Looks like you have been holding it.

10 Jul 2013, 7:48 PM
#8
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Problem & solution to additional customer status emails without customer info

Ah, this is not the situation I thought it was. Now I find out the admin customers file does not normally send out status emails to admin so nothing here is of any help whatsoever.
DrByte - make sure the mod I uploaded does not go live please.

11 Jul 2013, 1:12 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Problem & solution to additional customer status emails without customer info

Very well.

I was a little confused about what you were trying to accomplish. :)