Created
February 28, 2015 23:23
-
-
Save SeanChDavis/a9ad040a15aa61e08b32 to your computer and use it in GitHub Desktop.
EDD - Change From Email for sales notifications (and purchase receipts at the moment)
This file contains 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 // DO NOT COPY THIS LINE | |
function edd_sale_notification_from_customer( $from_email, $payment_id, $payment_data ) { | |
$the_user_email = $payment_data[ 'user_info' ][ 'user_email' ]; | |
if ( isset( $the_user_email ) ) { | |
return $the_user_email; | |
} else { | |
return $from_email; | |
} | |
} | |
add_filter( 'edd_purchase_from_address', 'edd_sale_notification_from_customer', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment