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.
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 returnfalse
.The solution is to load the address explicitly from the database before passing it to the mail sending method.