pmpro_insRecurringRestarted

Restart a subscription and send an email RE a recurring.

Description

pmpro_insRecurringRestarted( $morder ); 

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

Parameters (1)

0. $morder
The morder.

Usage

  1. if ( !function_exists( 'pmpro_insRecurringRestarted' ) ) { 
  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_insRecurringRestarted($morder); 
  9.  

Defined (1)

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

/services/twocheckout-ins.php  
  1. function pmpro_insRecurringRestarted( $morder ) { 
  2. global $pmpro_error; 
  3. //hook to do other stuff when payments restart 
  4. do_action("pmpro_subscription_recuring_restarted", $last_order); 
  5.  
  6. $worked = pmpro_changeMembershipLevel( $morder->membership_level->id, $morder->user->ID ); 
  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. $pmproemail = new PMProEmail(); 
  13. $pmproemail->sendCheckoutEmail( $morder->user, $morder ); 
  14.  
  15. //send email to admin 
  16. $pmproemail = new PMProEmail(); 
  17. $pmproemail->sendCheckoutAdminEmail( $morder->user, $morder ); 
  18.  
  19. inslog("Subscription restarted due to 'recurring restarted' INS notification."); 
  20.  
  21. return true; 
  22. else { 
  23. return false;