1

I create adminhtml/events.xml and frontend/events.html with code content:

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="adminhtml_customer_save_after">
        <observer name="send_member_information_update_mail" instance="TTV\Blog\Observer\SendMemberInformationUpdateMail " />
    </event>
</config>

I declare Observer/SendMemberInformationUpdateMail.php

namespace TTV\Blog\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Psr\Log\LoggerInterface;

class SendMemberInformationUpdateMail implements ObserverInterface
{
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        var_dump("Save By Customer");die;
    }
}

Please tell me: +To take events customer edit information or admin edit customer's information, What events I need take? ex: adminhtml_customer_save_after for admin right or wrong? +How I can send mail to customer when customer or admin change customer's information?

Thank you !

0

Yes, you can use below events for front-end and back-end/admin

Magento/Customer/Controller/Adminhtml/Index/Save.php

adminhtml_customer_save_after

Magento/Customer/Model/ResourceModel/CustomerRepository.php

customer_save_after_data_object

For sending custom mail, you can use below resource to send an email by passing Magento\Framework\Mail\Template\TransportBuilder into constructor.

Magento2- Send custom transactional emails

  • Dear krishna ijjada at i95Dev, When I take customer_save_after_data_object to take another edit information, Different user to create new account have been my action too. Do you known diffrent event? – ntmduy Sep 29 '16 at 6:23
  • Please tell me in more words. – Krishna ijjada Sep 29 '16 at 6:24
  • customer_save_after_data_object is events be used in create new user and edit information user. Please tell how to take edit information customer only? – ntmduy Sep 29 '16 at 6:28
  • You can use magento.stackexchange.com/questions/132963/… – Krishna ijjada Sep 29 '16 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.