Custom Notification Recipients not works

    • Giuseppe Guerrasio
      Participant
      # 6 months, 1 week ago

      Hi,

      i need to send admin notifications only to one administrator user.

       

      I try adding code on functions.php, but not works, all administrators continue to receive new content email.

       

      How can i solve?

    • Thomas
      Keymaster
      # 6 months, 1 week ago

      Hello,

      Don’t put code snippets in your theme functions.php file, use a custom plugin instead. Else, those functions will be triggered too late and not being executed.

      Also, do not hesitate to copy/paste there the code snippet you are using and I’ll let you know if it is correct.

      Regards.

      Want to help WP Customer Area? It only takes few seconds!
      Rate & review the plugin on WordPress.org 🙂

    • Giuseppe Guerrasio
      Participant
      # 6 months ago

      Hi,

      i dit it with custom plugin, but it continue to not works.

      Please can you helpe me?

    • Giuseppe Guerrasio
      Participant
      # 6 months ago

      PS I use this code:

      /**
      * Custom admin notifications recipients
      *
      * @param $recipients array Actual list of recipients that will receive admin notifications
      *
      * @return int[] admin recipients IDs
      */
      function wpca_customize_admin_notifications_recipients($recipients) {

      // This line will add new recipient to the list, with user ID 8, which will receive all admin notifications
      $recipients[] = 8;

      return $recipients;
      }
      add_filter(‘cuar/notifications/administrator-recipient-ids’, ‘wpca_customize_admin_notifications_recipients’);

    • Thomas
      Keymaster
      # 6 months ago

      Hello,

      This PHP syntax allows you to add a recipient to the actual list of administrators:

      $recipients[] = 8;

      Change it to this if you want to override the actual list:

      $recipients = [8];

      Regards.

       

      Want to help WP Customer Area? It only takes few seconds!
      Rate & review the plugin on WordPress.org 🙂

Viewing 4 reply threads

The topic ‘Custom Notification Recipients not works’ is closed to new replies.