Post by robert000 » Thu Jul 18, 2019 4:26 am

Hello.
How would I go about modifying OpenCart 3 so that email notifications go out to the admin whenever a customer edits their account information? (email, phone number etc) It doesn't need to go the customer; just to the admin.

This would operate much the same as email notifications for account register. Presumably I should copy the way register handles this. I have figured out that the code that sends out email upon account register is the alert function in catalog/controller/mail/register.php. But where is the code that calls this?

Newbie

Posts

Joined
Thu Jul 18, 2019 4:10 am

Post by grgr » Thu Jul 18, 2019 9:12 pm

It is triggered with an event:

Trigger

catalog/model/account/customer/addCustomer/after

Action

mail/register/alert

Image Image Image Image Image Image Image Image


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by robert000 » Fri Jul 19, 2019 4:41 am

I don't see an "after" there but I think I can figure this out. Thanks!

Newbie

Posts

Joined
Thu Jul 18, 2019 4:10 am

Post by grgr » Fri Jul 19, 2019 9:22 pm

The after refers to being after the ::addCustomer function has run as opposed to being a function called after.

Image Image Image Image Image Image Image Image


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by robert000 » Sat Jul 20, 2019 3:47 am

Yeah... I wasn't able to figure out how to make that work. I created a new file, controller/mail/edit.php, with an alert function patterned like the one in controller/mail/register.php along with necessary language files and view. But the alert wasn't getting called.

In the end I resolved this by just putting all the mail code in the editCustomer function of controller/event/activity.php. It's not the proper way to do it but I don't really have more time to be working on this problem.

Newbie

Posts

Joined
Thu Jul 18, 2019 4:10 am
Who is online

Users browsing this forum: No registered users and 28 guests