Commit 28591f91 authored by Rémi PAILHAREY's avatar Rémi PAILHAREY
Browse files

Merge branch 'feat/US739-optional-info-newsletter' into 'dev'

Feat/us739 optional info newsletter

See merge request web-et-numerique/llle_project/ecolyo!677
parents a3f22fec 1b73f8b2
......@@ -44,32 +44,40 @@
</mj-social>
</mj-column>
</mj-section>
<mj-section background-color="radial-gradient(96.2% 96.2% at 50% 3.8%, #343641 0%, #1B1C22 100%)">
<mj-column>
<mj-text css-class="title" color="white" font-weight="900" font-size="24px" align="center" >
L'info du mois
</mj-text>
<mj-image src="{{infoImage}}" width="82px" alt="nouveauté"></mj-image>
<mj-text color="white" font-weight="400" font-size="18px" css-class="custom-link">{{{infoText}}}</mj-text>
{{#if isServiceNews}}
<mj-divider css-class="m-divider"></mj-divider>
<mj-text css-class="title custom-link" color="white" font-weight="900" font-size="24px" align="center" >
{{newsTitle}}
</mj-text>
<mj-text color="white" font-weight="400" font-size="18px" css-class="custom-link" >{{{newsContent}}}</mj-text>
{{/if}}
{{#if isPoll}}
<mj-divider css-class="m-divider"></mj-divider>
<mj-text css-class="title " color="white" font-weight="900" font-size="24px" align="center" >
Votre avis nous intéresse
</mj-text>
<mj-text color="white" font-weight="400" font-size="18px" css-class="custom-link" >{{{pollText}}}</mj-text>
<mj-button color="black" background-color="#F1C017" css-class="button" font-size="20px" font-weight="700" >
<a href="{{pollUrl}}" style="text-decoration: none; color: black">C'est parti !</a>
</mj-button>
{{/if}}
</mj-column>
</mj-section>
{{#if isContent}}
<mj-section background-color="radial-gradient(96.2% 96.2% at 50% 3.8%, #343641 0%, #1B1C22 100%)">
<mj-column>
{{#if isInfo}}
<mj-text css-class="title" color="white" font-weight="900" font-size="24px" align="center" >
L'info du mois
</mj-text>
<mj-image src="{{infoImage}}" width="82px" alt="nouveauté"></mj-image>
<mj-text color="white" font-weight="400" font-size="18px" css-class="custom-link">{{{infoText}}}</mj-text>
{{/if}}
{{#if divider1}}
<mj-divider css-class="m-divider"></mj-divider>
{{/if}}
{{#if isServiceNews}}
<mj-text css-class="title custom-link" color="white" font-weight="900" font-size="24px" align="center" >
{{newsTitle}}
</mj-text>
<mj-text color="white" font-weight="400" font-size="18px" css-class="custom-link" >{{{newsContent}}}</mj-text>
{{/if}}
{{#if divider2}}
<mj-divider css-class="m-divider"></mj-divider>
{{/if}}
{{#if isPoll}}
<mj-text css-class="title " color="white" font-weight="900" font-size="24px" align="center" >
Votre avis nous intéresse
</mj-text>
<mj-text color="white" font-weight="400" font-size="18px" css-class="custom-link" >{{{pollText}}}</mj-text>
<mj-button color="black" background-color="#F1C017" css-class="button" font-size="20px" font-weight="700" >
<a href="{{pollUrl}}" style="text-decoration: none; color: black">C'est parti !</a>
</mj-button>
{{/if}}
</mj-column>
</mj-section>
{{/if}}
<mj-section background-color="#121212">
<mj-column vertical-align="middle">
<mj-image src={{feedbackImageUrl}} width="53px" align="center" alt="feedback"></mj-image>
......
......@@ -245,12 +245,14 @@ const monthlyReportNotification = async ({
const consumptionText = await buildConsumptionText(client)
const isPoll: boolean =
monthlyReport.question !== '' && monthlyReport.link !== ''
const isInfo: boolean = monthlyReport.info !== ''
const isServiceNews: boolean =
monthlyReport.newsTitle !== '' && monthlyReport.newsContent !== ''
const isPoll: boolean =
monthlyReport.question !== '' && monthlyReport.link !== ''
const date = DateTime.local()
.setZone('utc', { keepLocalTime: true })
.minus({ month: 1 })
......@@ -271,7 +273,11 @@ const monthlyReportNotification = async ({
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(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment