pmpro_insRecurringStopped

Cancel a subscription and send an email RE a recurring.

Description

pmpro_insRecurringStopped( $morder ); 

$morder passed in is the previous order for this subscription.

Parameters (1)

0. $morder
The morder.

Usage

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

Defined (1)

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

/services/twocheckout-ins.php  
  1. function pmpro_insRecurringStopped( $morder ) { 
  2. global $pmpro_error; 
  3. //hook to do other stuff when payments stop 
  4. do_action("pmpro_subscription_recuring_stopped", $last_order); 
  5.  
  6. $worked = pmpro_changeMembershipLevel( false, $morder->user->ID , 'inactive'); 
  7. if( $worked === true ) { 
  8. //$pmpro_msg = __("Your membership has been cancelled.", 'paid-memberships-pro' ); 
  9. //$pmpro_msgt = "pmpro_success"; 
  10.  
  11. //send an email to the member 
  12. $myemail = new PMProEmail(); 
  13. $myemail->sendCancelEmail(); 
  14.  
  15. //send an email to the admin 
  16. $myemail = new PMProEmail(); 
  17. $myemail->sendCancelAdminEmail( $morder->user, $morder->membership_level->id ); 
  18.  
  19. inslog("Subscription cancelled due to 'recurring stopped' INS notification."); 
  20.  
  21. return true; 
  22. else { 
  23. return false;