Skip to content

Commit

Permalink
Merge pull request #2 from Kuzrys/email_to_filter
Browse files Browse the repository at this point in the history
Added email_to filter
  • Loading branch information
upsellpl committed Jan 19, 2021
2 parents ddb61f0 + bae1a20 commit 45643f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions includes/gateways/paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,14 @@ function edd_process_paypal_ipn() {
if( isset( $edd_options['paypal_disable_curl'] ) ) {
$listener->use_curl = false;
}


$to_email = apply_filters( 'wpi_admin_notices_email', get_option( 'admin_email' ) );

try {
$listener->requirePostMethod();
$verified = $listener->processIpn();
} catch( Exception $e ) {
wp_mail( get_bloginfo('admin_email'), 'IPN Error', $e->getMessage() );
wp_mail( $to_email, 'IPN Error', $e->getMessage() );
exit(0);
}

Expand Down Expand Up @@ -264,7 +266,7 @@ function edd_process_paypal_ipn() {
}

} else {
wp_mail( get_bloginfo('admin_email'), __( 'Invalid IPN', 'edd' ), $listener->getTextReport() );
wp_mail( $to_email, __( 'Invalid IPN', 'edd' ), $listener->getTextReport() );
}
}
add_action( 'edd_verify_paypal_ipn', 'edd_process_paypal_ipn' );
3 changes: 2 additions & 1 deletion includes/user-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ function edd_new_user_notification( $user_id = 0, $user_data = array() ) {

$emails->__set( 'heading', $admin_heading );

$emails->send( get_option( 'admin_email' ), $admin_subject, $admin_message );
$to_email = apply_filters( 'wpi_admin_notices_email', get_option( 'admin_email' ) );
$emails->send( $to_email, $admin_subject, $admin_message );

$user_subject = sprintf( __( '[%s] Your username and password', 'easy-digital-downloads' ), $from_name );
$user_heading = __( 'Your account info', 'easy-digital-downloads' );
Expand Down

0 comments on commit 45643f7

Please sign in to comment.