Custom Notification Recipients not works

    • Giuseppe Guerrasio
      Participant
      # il y a 1 année et 2 mois

      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
      Maître des clés
      # il y a 1 année et 2 mois

      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
      # il y a 1 année et 2 mois

      Hi,

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

      Please can you helpe me?

    • Giuseppe Guerrasio
      Participant
      # il y a 1 année et 2 mois

      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
      Maître des clés
      # il y a 1 année et 2 mois

      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 🙂

Vous lisez 4 fils de discussion

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