Vinai / customer-activation

Magento extension which makes it impossible for a customer to log in until the account has been activated by the administrator.
120 stars 59 forks source link

Explicitly load the customer address from the database for new customers #110

Closed markvds closed 7 years ago

markvds commented 7 years ago

Funny how apparently nobody noticed this before. At the moment that the customer activation mail gets sent, the customer object has just been saved. The attributes 'default_billing' and 'default_shipping' are already filled, but the address is not yet loaded in the customer object's addresses collection. So a call to $customer->getPrimaryBillingAddress() will not return the default billing address of the customer, but instead return false.

The solution is to load the address explicitly from the database before passing it to the mail sending method.

markvds commented 7 years ago

I was wrong! Someone noticed it years earlier, but didn't find a solid solution: #45

andrewhowdencom commented 7 years ago

Heya Mark! Thanks for your contribution, it's much appreciated. Let me know if you find anything else!