Skip to content

Instantly share code, notes, and snippets.

@SeanChDavis
Created February 28, 2015 23:23
Show Gist options
  • Save SeanChDavis/a9ad040a15aa61e08b32 to your computer and use it in GitHub Desktop.
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)
<?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