Custom changes when changing pro-sites level

I am using pro-sites and and I have modified the function - email_notification($blog_id, $action, $email = false) in pro-sites.php

I only want my script to run when a payment is actually made. So my question is, in the following code, I know that $action = 'success' on a first time payment, but will $action = 'receipt' on a recurring monthly payment? I also realize that tapping into the core pro-sites.php file is probably not a good idea. Does anyone have any other solutions for doing this?

function email_notification($blog_id, $action, $email = false) {
	  global $wpdb;

		if (!$email)
			$email = get_blog_option($blog_id, 'admin_email');

		<!-- My Code -->
             if ($action == 'success' || $action == 'receipt') {
			$level_result = $this->get_level($blog_id);
			require_once (ABSPATH .'/user_update.php');
               <!-- End My Code -->
	  if ($action == 'success') {

      $message = str_replace( 'LEVEL', $this->get_level_setting($this->get_level($blog_id), 'name'), $this->get_setting('success_msg') );
			$message = str_replace( 'SITEURL', get_site_url( $blog_id ), $message );
			$message = str_replace( 'SITENAME', get_blog_option($blog_id, 'blogname'), $message );

	    wp_mail( $email, $this->get_setting('success_subject'), $message );

	    $this->log_action( $blog_id, sprintf(__('Signup success email sent to %s', 'psts'), $email) );

	  } else if ($action == 'receipt') {............
  • Mason
    • DEV MAN’s Sidekick


    will $action = 'receipt' on a recurring monthly payment?

    I believe that's correct. Looks that way from the function.

    As to an alternate way to go about it (and just to confirm the above) I'm going to ask the developer to stop in and respond directly.


  • glocare
    • Flash Drive

    When I said I only want the script to run when a payment is made, I meant to say when a payment is made or when the receipt button is pressed.

    I should add, that in the pro-sites when you click Send Receipt, than the action is ='receipt' but I am not sure if this is the case when a recurring monthly payment is made. In other words, is a receipt sent to the customer every recurring payment.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.