pmpro_ipnCheckReceiverEmail

Check that the email sent by PayPal matches our settings.

Description

pmpro_ipnCheckReceiverEmail( $email ); 

Parameters (1)

0. $email
The email.

Usage

  1. if ( !function_exists( 'pmpro_ipnCheckReceiverEmail' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/services/ipnhandler.php'; 
  3.  
  4. // The email. 
  5. $email = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = pmpro_ipnCheckReceiverEmail($email); 
  9.  

Defined (1)

The function is defined in the following location(s).

/services/ipnhandler.php  
  1. function pmpro_ipnCheckReceiverEmail( $email ) { 
  2. if ( ! is_array( $email ) ) { 
  3. $email = array( $email ); 
  4.  
  5. if ( ! in_array( strtolower( pmpro_getOption( 'gateway_email' ) ), $email ) ) { 
  6. $r = false; 
  7. } else { 
  8. $r = true; 
  9.  
  10. $r = apply_filters( 'pmpro_ipn_check_receiver_email', $r, $email ); 
  11.  
  12. if ( $r ) { 
  13. return true; 
  14. } else { 
  15. if ( ! empty( $_POST['receiver_email'] ) ) { 
  16. $receiver_email = $_POST['receiver_email']; 
  17. } else { 
  18. $receiver_email = "N/A"; 
  19.  
  20. if ( ! empty( $_POST['business'] ) ) { 
  21. $business = $_POST['business']; 
  22. } else { 
  23. $business = "N/A"; 
  24.  
  25. //not yours 
  26. ipnlog( "ERROR: receiver_email (" . $receiver_email . ") and business email (" . $business . ") did not match (" . pmpro_getOption( 'gateway_email' ) . ")" ); 
  27.  
  28. return false; 
  29.