I have added a custom attribute for storing additional emails for customers.

By default, when an order is placed, the customer_email field in sales_order table is taking from the email field from customer_entity. However, I need the customer_email field to use my custom attribute.

How can I do this?

2 Answers 2


You need to do following thins.

  1. Use "sales_order_place_after" event in your custom extension.

  2. In code, get value of customer_email using order object and save value into your custom_attribute as well.

  • When using sales_order_place_after event, can I get my custom attribute from \Magento\Customer\Model\Session $customerSession? Apr 24, 2018 at 13:56
  • You can load customer by email and used any custom attribute value of that customer associated with order. Apr 24, 2018 at 14:04

This is my solution,

  1. I use event sales_order_place_after in my custom module.

  2. I used this solution to get my customer custom attribute and set it to customer_email in sales_order table

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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