Mail to admin & user when a new message is posted

    • Antoine Di Girolamo
      Participant
      # 1 year, 5 months ago

      Bonjour,

      Je rencontre un problème avec l’add-on conversation, lors de l’ajout d’un message à une conversation entre un admin et user (ajouter dans Utilisateurs), les 2 reçoivent le mail de notification de Nouvelle réponse à une conversation, dans mon idée lorsque l’admin ajoute un msg l’user devrait recevoir le message et quand l’user ajoute un msg l’admin devrait recevoir un msg.

      Est-ce un problème de configuration ? Existe t’il un snippet ?

      Par avance merci !

       

      Hello,
      I have a problem with the conversation add-on, when adding a message to a conversation between an admin and user (add in Users), both receive the notification email of “New reply to a conversation”, in my idea when the admin adds a msg the user should receive the message and when the user adds a msg the admin should receive a msg.

      Is it a configuration problem? Is there a snippet?

      Thanks in advance !

    • Thomas
      Keymaster
      # 1 year, 5 months ago

      Bonjour,

      En effet, les notifications de type “conversations replies” sont envoyées aux assignés ET à l’auteur du post.

      Je vais voir pour rajouter une checkbox dans les paramètres de notification du type : “disable notifications to self”.

      Je vous tiens au courant.

      Cdlt.

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

    • Thomas
      Keymaster
      # 1 year, 5 months ago

      Bonjour,

      Vérification faite, il n’y a pas besoin de mise à jour. Voici effectivement un code snippet qui répondra à votre besoin :

      /**
       * Disable self notifications for conversation new replies
       *
       * @param $enabled         bool Notification enabled/disabled
       * @param $recipient_id    int User ID to whom the notification is being sent
       * @param $notification_id int Notification type ID
       * @param $post_id         int Post ID related the notification
       * @param $notif_settings  array Notifcation settings
       * @param $extra           array Additional email parameters
       * @return bool
       */
      function wpca_enable_self_notifications($enabled, $recipient_id, $notification_id, $post_id, $notif_settings, $extra)
      {
          // Disable notification to self for new replies
          if($notification_id === 'private-conversation-new-reply') {
              $enabled = false;
          }
      
          return $enabled;
      }
      add_filter('cuar/notifications/allow-notification-to-self', 'wpca_enable_self_notifications', 20, 6);

      Veuillez consulter notre documentation sur les codes snippets afin de comprendre comment l’utiliser.

      Cdlt.

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

Viewing 2 reply threads

The topic ‘Mail to admin & user when a new message is posted’ is closed to new replies.