Last active
December 27, 2015 03:28
-
-
Save amdrew/7259097 to your computer and use it in GitHub Desktop.
Add payment meta information to the admin sales notification in Easy Digital Downloads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_child_theme_edd_sale_notification( $email_body, $payment_id, $payment_data ) { | |
// retrieve payment meta array and unserialize it | |
$payment_meta = maybe_unserialize( get_post_meta( $payment_id, '_edd_payment_meta', true ) ); | |
// add your fields here | |
$company = $payment_meta['company']; | |
$phone = $payment_meta['phone']; | |
// append information to email body | |
$email_body .= '<br /><br />' . '<strong>Additional Information</strong>' . '<br />'; | |
$email_body .= 'Company: ' . $company . '<br />'; | |
$email_body .= 'Phone: ' . $phone; | |
return $email_body; | |
} | |
add_filter( 'edd_sale_notification', 'my_child_theme_edd_sale_notification', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment