Email Admin When Customer Changes Address In Profile

We have a problem when a customer changes their address after an order is placed. The cart does not notify the Store Owner that this has occurred.

Is there a way to mod the cart to email the Admin when a customer modifies their address after the order has been placed.

This is especially important because we maintain a separate customer database.

Add the appropriate notification ($notification['A']=true) to the code that updates the customer with their new info.

Thanks. Can you elaborate a little more. I am not sure I understand what change you are asking me to make.

Open the app/functions/fn.users.php file, find the fn_update_user function and add this code:

Mailer::sendMail(array(
            'to' => $from,
            'from' => $user_data['email'],
            'data' => array(
                'user_data' => $user_data,
            ),
            'tpl' => 'profiles/' . $prefix . '_profile.tpl',
            'company_id' => $user_data['company_id']
        ), fn_check_user_type_admin_area($user_data['user_type']) ? 'A' : 'C', $lang_code);

after this code:

Mailer::sendMail(array(
            'to' => $user_data['email'],
            'from' => $from,
            'data' => array(
                'password' => $password,
                'user_data' => $user_data,
            ),
            'tpl' => 'profiles/' . $prefix . '_profile.tpl',
            'company_id' => $user_data['company_id']
        ), fn_check_user_type_admin_area($user_data['user_type']) ? 'A' : 'C', $lang_code);

If you're going to do it there, why not just change:

'to' => $user_data['email'],

to

'to' => $user_data['email'],
'bcc'=>$from,

In other words, why send the same email twice? I know that cs-cart does this as standard practice, but a separate receipt (for like an order) isn't really a legal document when you can't show that the 'to' field was to the user. This way you get a blind copy of what was actually sent to the customer with them in the 'to' field, not you.

Good solution! I did not know about the bcc option. Did you test it? I do not see this parameter in the code of the Mailer class

bcc works fine, we used it in some of our custom add-ons

bcc works fine, we used it in some of our custom add-ons

Thank you for the information

Hmm... memory is fading a bit... I think if I remember correctly that I actually needed to use the 'send_mail_pre' hook and then use the $mailer->addrAppend('Bcc', 'bcc-email@address');

But it should be added to the Mailer class because it's such a simple solution and the right way to "copy" receipts, invoices and other semi-legal documents.

Thanks, I’ll give that a try because the bcc by itself did not work.

Hmm... memory is fading a bit... I think if I remember correctly that I actually needed to use the 'send_mail_pre' hook and then use the $mailer->addrAppend('Bcc', 'bcc-email@address');

But it should be added to the Mailer class because it's such a simple solution and the right way to "copy" receipts, invoices and other semi-legal documents.

Thank you for the information. We will also check it