I'm using Commerce with the Commerce E-mail module to customize the e-mail sent to admins whenever there is an order (a payment is received) at the store. Payment is handled using PayPal WPS through the Commerce PayPal module.
On my site, buyers must input their e-mail addresses before moving on to PayPal, but these e-mail addresses (on my site) sometimes differ from the e-mail addresses registered on buyers' PayPal accounts.
For this reason, I want the admin e-mail (sent when an order is paid for) to include both the e-mail address that the buyer input on my Drupal site as well as their PayPal e-mail address.
Commerce E-mail provides a
[commerce-email:order-items] token, but there is no token for the PayPal WPS information. This information is stored within Drupal; in the Order Admin UI, if you click on the payment details of the transaction, under Payload there is a printout of an Array that includes
[payer_email] => email@example.com.
Array ( [13775355555-ipn] => Array ( [mc_gross] => 17.00 [invoice] => 555-1377531555 [protection_eligibility] => Eligible [payer_email] => firstname.lastname@example.org
How can I add the buyer's PayPal registered e-mail address (
[payer_email]) into the admin e-mail sent by Commerce? It would be great if the solution would also allow use of other information in the payload array, such as the buyer's physical address.