From 7a87ca7c01ab6e7d88e272593ad27a80f872831c Mon Sep 17 00:00:00 2001
From: Sebastian Mihalache <sebastian.mihalache@gmail.con>
Date: Thu, 27 Sep 2018 16:57:05 +0300
Subject: [PATCH] fix(recommendations): send email to HE when rev publish

---
 .../notifications/notifications.js                        | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/notifications/notifications.js b/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/notifications/notifications.js
index c930744e7..4b1119a2e 100644
--- a/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/notifications/notifications.js
+++ b/packages/component-manuscript-manager/src/routes/fragmentsRecommendations/notifications/notifications.js
@@ -74,10 +74,12 @@ module.exports = {
 
     // send HE emails when a review is submitted
     // or when the EiC makes a recommendation after peer review
+
     if (
-      (isEditorInChief || recommendationType === 'review') &&
-      hasPeerReview &&
-      (recommendation !== 'publish' || hasEQA)
+      recommendationType === 'review' ||
+      (isEditorInChief &&
+        hasPeerReview &&
+        (recommendation !== 'publish' || hasEQA))
     ) {
       const handlingEditor = get(collection, 'handlingEditor', {})
       const heUser = await UserModel.find(handlingEditor.id)
-- 
GitLab