Additional Admin Notifications

This seems like such an obvious feature but I don’t see a way to create additional admin notifications when people register as an affiliate. The admin notification works great for me (as the site admin) but I need the “new affiliate registration” email, etc. to go to others on my team. I don’t see a way to set that and didn’t see anything in the forums (which makes me think I’m missing something). Please advise.

Posted in

Comments

3 responses to “Additional Admin Notifications”

  1. Ben DeLoach Avatar
    Ben DeLoach

    Thanks for confirming the limitation.

    I am the site admin but I don’t run the business. See the problem? I need to be able to send those notifications to the people who DO run the business and are responsible for setting up and connecting with affiliates.

    I can’t just set their email as the site admin email because the site admin email gets dozens of other notifications (things I need that they don’t).

    Please add this as a feature request. Until then, I’m glad to create a hook or filter if the dev team can give me a little guidance on this.

    1. Eugen Bleck Avatar
      Eugen Bleck

      Hi Ben,

      Thank you so much for the prompt feedback.

      You can use our affiliates_added_affiliate hook to fix this. Please effect the following changes using your child theme:

      * Open your child theme’s functions.php
      * Add the following code snippet:
      add_action('affiliates_added_affiliate', 'extra_email_affiliates_added_affiliate');
      function extra_email_affiliates_added_affiliate($user_id)
      {
      $user = new WP_User($user_id);
      $user_login = stripslashes($user->user_login);
      $user_email = stripslashes($user->user_email);
      /* Enter your new email */
      $email = "example@itthinx.com";
      $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
      $message = sprintf(__('New affiliate registration on your site %s:', AFFILIATES_PLUGIN_DOMAIN), $blogname) . "\r\n\r\n";
      $message .= sprintf(__('Username: %s', AFFILIATES_PLUGIN_DOMAIN), $user_login) . "\r\n\r\n";
      $message .= sprintf(__('E-mail: %s', AFFILIATES_PLUGIN_DOMAIN), $user_email) . "\r\n";
      if (get_option('aff_notify_admin', true)) {
      @wp_mail($email, sprintf(__('[%s] New Affiliate Registration', AFFILIATES_PLUGIN_DOMAIN), $blogname), $message);
      }
      }

      Please note that you would have to replace example@itthinx.com with the clients desired email.

      Please STAY SAFE and I wish you a wonderful and productive week ahead!
      Best,
      Eugen.

  2. Eugen Bleck Avatar
    Eugen Bleck

    Hi there Ben,

    Good afternoon and happy new week!

    I trust you are well and safe! Thank you so much for reaching out and for asking your question.

    Regarding your inquiry, new affiliate registration emails are sent to the site admin and the registering affiliate only, however, I would ask the dev team if this can be considered as a featured request. You can read more on notifications here.

    I remain available if you have any further inquiries!

    Please STAY SAFE and I wish you a wonderful and productive week ahead!
    Best,
    Eugen.

Share