From dfaf23fc636de8a9f8deb5f8ade795ec9793e95f Mon Sep 17 00:00:00 2001
From: build-pipeline <build-token>
Date: Thu, 7 Jul 2022 15:08:41 +0000
Subject: [PATCH] publish: Merge branch 'feat/US739-optional-info-newsletter'
 into 'dev'

generated from commit 28591f91826270690f1937148c482e9360025667
---
 services/monthlyReportNotification/ecolyo.js | 62 +++++++++++++++-----
 1 file changed, 47 insertions(+), 15 deletions(-)

diff --git a/services/monthlyReportNotification/ecolyo.js b/services/monthlyReportNotification/ecolyo.js
index b1be34bb7..e9853d4af 100644
--- a/services/monthlyReportNotification/ecolyo.js
+++ b/services/monthlyReportNotification/ecolyo.js
@@ -148468,8 +148468,9 @@ const monthlyReportNotification = async ({
   }
 
   const consumptionText = await buildConsumptionText(client);
-  const isPoll = monthlyReport.question !== '' && monthlyReport.link !== '';
+  const isInfo = monthlyReport.info !== '';
   const isServiceNews = monthlyReport.newsTitle !== '' && monthlyReport.newsContent !== '';
+  const isPoll = monthlyReport.question !== '' && monthlyReport.link !== '';
 
   const date = _luxon.DateTime.local().setZone('utc', {
     keepLocalTime: true
@@ -148489,7 +148490,11 @@ const monthlyReportNotification = async ({
     consumptionText: consumptionText.replace(/{cozyUrl}/g, appLink + '#/'),
     infoText: monthlyReport.info.replace(/{cozyUrl}/g, appLink + '#/'),
     infoImage: monthlyReport.image !== '' ? baseUrl + monthlyReport.image : baseUrl + '/assets/astuce.png',
+    isContent: isInfo || isServiceNews || isPoll,
+    isInfo: isInfo,
+    divider1: isInfo && isServiceNews || isInfo && isPoll,
     isServiceNews: isServiceNews,
+    divider2: isServiceNews && isPoll,
     isPoll: isPoll,
     newsTitle: monthlyReport.newsTitle.replace(/{cozyUrl}/g, appLink + '#/'),
     newsContent: monthlyReport.newsContent.replace(/{cozyUrl}/g, appLink + '#/'),
@@ -148537,6 +148542,36 @@ module.exports = (Handlebars["default"] || Handlebars).template({"1":function(co
     + ((stack1 = alias1((depth0 != null ? lookupProperty(depth0,"consumptionText") : depth0), depth0)) != null ? stack1 : "")
     + "<br /></mj-text>\n";
 },"5":function(container,depth0,helpers,partials,data) {
+    var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
+        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
+          return parent[propertyName];
+        }
+        return undefined
+    };
+
+  return "      <mj-section background-color=\"radial-gradient(96.2% 96.2% at 50% 3.8%, #343641 0%, #1B1C22 100%)\">\n        <mj-column>\n"
+    + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isInfo") : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":50,"column":10},"end":{"line":56,"column":17}}})) != null ? stack1 : "")
+    + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"divider1") : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":57,"column":10},"end":{"line":59,"column":17}}})) != null ? stack1 : "")
+    + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isServiceNews") : depth0),{"name":"if","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":60,"column":10},"end":{"line":65,"column":17}}})) != null ? stack1 : "")
+    + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"divider2") : depth0),{"name":"if","hash":{},"fn":container.program(12, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":66,"column":10},"end":{"line":68,"column":17}}})) != null ? stack1 : "")
+    + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isPoll") : depth0),{"name":"if","hash":{},"fn":container.program(14, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":69,"column":10},"end":{"line":77,"column":17}}})) != null ? stack1 : "")
+    + "        </mj-column>\n      </mj-section>\n";
+},"6":function(container,depth0,helpers,partials,data) {
+    var stack1, alias1=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
+        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
+          return parent[propertyName];
+        }
+        return undefined
+    };
+
+  return "            <mj-text css-class=\"title\" color=\"white\" font-weight=\"900\" font-size=\"24px\" align=\"center\" >\n              L'info du mois\n            </mj-text>\n            <mj-image src=\""
+    + container.escapeExpression(alias1((depth0 != null ? lookupProperty(depth0,"infoImage") : depth0), depth0))
+    + "\" width=\"82px\" alt=\"nouveauté\"></mj-image>\n            <mj-text color=\"white\" font-weight=\"400\" font-size=\"18px\" css-class=\"custom-link\">"
+    + ((stack1 = alias1((depth0 != null ? lookupProperty(depth0,"infoText") : depth0), depth0)) != null ? stack1 : "")
+    + "</mj-text>\n";
+},"8":function(container,depth0,helpers,partials,data) {
+    return "            <mj-divider css-class=\"m-divider\"></mj-divider>\n";
+},"10":function(container,depth0,helpers,partials,data) {
     var stack1, alias1=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
         if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
           return parent[propertyName];
@@ -148544,12 +148579,14 @@ module.exports = (Handlebars["default"] || Handlebars).template({"1":function(co
         return undefined
     };
 
-  return "          <mj-divider css-class=\"m-divider\"></mj-divider>\n          <mj-text css-class=\"title custom-link\" color=\"white\" font-weight=\"900\" font-size=\"24px\" align=\"center\" >\n            "
+  return "            <mj-text css-class=\"title custom-link\" color=\"white\" font-weight=\"900\" font-size=\"24px\" align=\"center\" >\n              "
     + container.escapeExpression(alias1((depth0 != null ? lookupProperty(depth0,"newsTitle") : depth0), depth0))
-    + "\n          </mj-text>\n          <mj-text color=\"white\" font-weight=\"400\" font-size=\"18px\" css-class=\"custom-link\" >"
+    + "\n            </mj-text>\n            <mj-text color=\"white\" font-weight=\"400\" font-size=\"18px\" css-class=\"custom-link\" >"
     + ((stack1 = alias1((depth0 != null ? lookupProperty(depth0,"newsContent") : depth0), depth0)) != null ? stack1 : "")
     + "</mj-text>\n";
-},"7":function(container,depth0,helpers,partials,data) {
+},"12":function(container,depth0,helpers,partials,data) {
+    return "              <mj-divider css-class=\"m-divider\"></mj-divider>\n";
+},"14":function(container,depth0,helpers,partials,data) {
     var stack1, alias1=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
         if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
           return parent[propertyName];
@@ -148557,11 +148594,11 @@ module.exports = (Handlebars["default"] || Handlebars).template({"1":function(co
         return undefined
     };
 
-  return "          <mj-divider css-class=\"m-divider\"></mj-divider>\n          <mj-text css-class=\"title \" color=\"white\" font-weight=\"900\" font-size=\"24px\" align=\"center\" >\n            Votre avis nous intéresse\n          </mj-text>\n          <mj-text color=\"white\" font-weight=\"400\" font-size=\"18px\" css-class=\"custom-link\" >"
+  return "            <mj-text css-class=\"title \" color=\"white\" font-weight=\"900\" font-size=\"24px\" align=\"center\" >\n              Votre avis nous intéresse\n            </mj-text>\n            <mj-text color=\"white\" font-weight=\"400\" font-size=\"18px\" css-class=\"custom-link\" >"
     + ((stack1 = alias1((depth0 != null ? lookupProperty(depth0,"pollText") : depth0), depth0)) != null ? stack1 : "")
-    + "</mj-text>\n          <mj-button color=\"black\" background-color=\"#F1C017\" css-class=\"button\" font-size=\"20px\" font-weight=\"700\" >\n            <a href=\""
+    + "</mj-text>\n            <mj-button color=\"black\" background-color=\"#F1C017\" css-class=\"button\" font-size=\"20px\" font-weight=\"700\" >\n              <a href=\""
     + container.escapeExpression(alias1((depth0 != null ? lookupProperty(depth0,"pollUrl") : depth0), depth0))
-    + "\" style=\"text-decoration: none; color: black\">C'est parti !</a>\n          </mj-button>\n";
+    + "\" style=\"text-decoration: none; color: black\">C'est parti !</a>\n            </mj-button>\n";
 },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
     var stack1, alias1=container.lambda, alias2=container.escapeExpression, alias3=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
         if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
@@ -148584,14 +148621,9 @@ module.exports = (Handlebars["default"] || Handlebars).template({"1":function(co
     + alias2(alias1((depth0 != null ? lookupProperty(depth0,"baseUrl") : depth0), depth0))
     + "/assets/ecolyo-icon.png\" name=\"ecolyo\" padding=\"0 10px 0 0\" href=\""
     + alias2(alias1((depth0 != null ? lookupProperty(depth0,"clientUrl") : depth0), depth0))
-    + "\">\n            Voir mon bilan\n          </mj-social-element>\n        </mj-social>\n      </mj-column>\n    </mj-section>\n    <mj-section background-color=\"radial-gradient(96.2% 96.2% at 50% 3.8%, #343641 0%, #1B1C22 100%)\">\n      <mj-column>\n          <mj-text css-class=\"title\" color=\"white\" font-weight=\"900\" font-size=\"24px\" align=\"center\" >\n            L'info du mois\n          </mj-text>\n          <mj-image src=\""
-    + alias2(alias1((depth0 != null ? lookupProperty(depth0,"infoImage") : depth0), depth0))
-    + "\" width=\"82px\" alt=\"nouveauté\"></mj-image>\n          <mj-text color=\"white\" font-weight=\"400\" font-size=\"18px\" css-class=\"custom-link\">"
-    + ((stack1 = alias1((depth0 != null ? lookupProperty(depth0,"infoText") : depth0), depth0)) != null ? stack1 : "")
-    + "</mj-text>\n"
-    + ((stack1 = lookupProperty(helpers,"if").call(alias3,(depth0 != null ? lookupProperty(depth0,"isServiceNews") : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":54,"column":8},"end":{"line":60,"column":15}}})) != null ? stack1 : "")
-    + ((stack1 = lookupProperty(helpers,"if").call(alias3,(depth0 != null ? lookupProperty(depth0,"isPoll") : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":61,"column":8},"end":{"line":70,"column":15}}})) != null ? stack1 : "")
-    + "      </mj-column>\n    </mj-section>\n    <mj-section background-color=\"#121212\">\n      <mj-column vertical-align=\"middle\">\n        <mj-image src="
+    + "\">\n            Voir mon bilan\n          </mj-social-element>\n        </mj-social>\n      </mj-column>\n    </mj-section>\n"
+    + ((stack1 = lookupProperty(helpers,"if").call(alias3,(depth0 != null ? lookupProperty(depth0,"isContent") : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":47,"column":4},"end":{"line":80,"column":11}}})) != null ? stack1 : "")
+    + "    <mj-section background-color=\"#121212\">\n      <mj-column vertical-align=\"middle\">\n        <mj-image src="
     + alias2(alias1((depth0 != null ? lookupProperty(depth0,"feedbackImageUrl") : depth0), depth0))
     + " width=\"53px\" align=\"center\" alt=\"feedback\"></mj-image>\n        <mj-text color=\"white\" font-weight=\"900\" align=\"center\" font-size=\"18px\">\n          Un problème, une question, une suggestion ?\n        </mj-text>\n        <mj-text color=\"white\" align=\"center\" font-size=\"18px\">\n          N'hésitez pas à nous écrire via la bulle dans le service.\n        </mj-text>\n      </mj-column>\n    </mj-section>\n    <mj-section background-color=\"black\">\n      <mj-column>\n"
     + ((stack1 = container.invokePartial(__webpack_require__(1481),depth0,{"name":"base/footer","fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
-- 
GitLab