sendUnread(userId) {
    if (userId) {
      const notificatonsSent = new Promise((resolve, reject) => {
        this.notificationController
          .getAllUnread(userId)
          .then((notifications) => {
            const sentNotifications = notifications.map((notification) => {
              const sentNotification = this.send('unread', notification);
              return sentNotification;
            });
            return Promise.all(sentNotifications);
          })
          .then((notifications) => {
            resolve(notifications);
          })
          .catch((err) => {
            reject(err);
          });
      });
      return notificatonsSent;
    }

    return null;
  }
/**
   * Sends all the unread notifications by user id
   * @param  {string} userId user identifier
   */
Sends all the unread notifications by user id
@param  {string} userId user identifier
Sends all the unread notifications by user id @param { string } userId user identifier
sendUnread(userId) {
    if (userId) {
      const notificatonsSent = new Promise((resolve, reject) => {
        this.notificationController
          .getAllUnread(userId)
          .then((notifications) => {
            const sentNotifications = notifications.map((notification) => {
              const sentNotification = this.send('unread', notification);
              return sentNotification;
            });
            return Promise.all(sentNotifications);
          })
          .then((notifications) => {
            resolve(notifications);
          })
          .catch((err) => {
            reject(err);
          });
      });
      return notificatonsSent;
    }
    return null;
  }
sendUnread ( userId ) { if ( userId ) { const notificatonsSent = new Promise ( ( resolve , reject ) => { this . notificationController . getAllUnread ( userId ) . then ( ( notifications ) => { const sentNotifications = notifications . map ( ( notification ) => { const sentNotification = this . send ( 'unread' , notification ) ; return sentNotification ; } ) ; return Promise . all ( sentNotifications ) ; } ) . then ( ( notifications ) => { resolve ( notifications ) ; } ) . catch ( ( err ) => { reject ( err ) ; } ) ; } ) ; return notificatonsSent ; } return null ; }
Sends all the unread notifications by user id
 @param  {string} userId user identifier
Sends all the unread notifications by user id @param { string } userId user identifier