Skip to content
Snippets Groups Projects
Commit 2abb6675 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

fix(mail): change text for consumption and alert email

parent 4362589b
Branches
Tags
1 merge request!435WIP: 1.4.0
......@@ -52,7 +52,7 @@
</mj-text>
<mj-text color="white" font-weight="400" font-size="18px" align="center" css-class="custom-link">{{{pollText}}}</mj-text>
<mj-button color="black" background-color="#F1C017" css-class="button" font-size="20px" font-weight="700" font-family="Lato">
<a href="{{pollUrl}}" style="text-decoration: none; color: black">C'est parti!</a>
<a href="{{pollUrl}}" style="text-decoration: none; color: black">C'est parti !</a>
</mj-button>
{{/if}}
</mj-column>
......
......@@ -85,7 +85,7 @@ const consumptionAlert = async ({ client }: ConsumptionAlertProps) => {
const mailData = {
mode: 'noreply',
subject: '[Ecolyo] - Consommation maximale atteinte',
subject: '[Ecolyo] - Ça déborde !',
parts: [
{
type: 'text/html',
......
......@@ -70,9 +70,9 @@ const buildConsumptionText = async (client: Client) => {
: 0
if (value) {
if (value > 0) {
text += '+' + (value * 100).toFixed(2) + "% d'électricité"
text += '+' + (value * 100).toFixed(2) + " % d'électricité"
} else {
text += (value * 100).toFixed(2) + "% d'électricité"
text += (value * 100).toFixed(2) + " % d'électricité"
}
}
}
......@@ -87,9 +87,9 @@ const buildConsumptionText = async (client: Client) => {
text += ', '
}
if (value > 0) {
text += '+' + (value * 100).toFixed(2) + '% de gaz'
text += '+' + (value * 100).toFixed(2) + ' % de gaz'
} else {
text += (value * 100).toFixed(2) + '% de gaz'
text += (value * 100).toFixed(2) + ' % de gaz'
}
}
}
......@@ -102,9 +102,9 @@ const buildConsumptionText = async (client: Client) => {
text += ', '
}
if (value > 0) {
text += '+' + (value * 100).toFixed(2) + "% d'eau"
text += '+' + (value * 100).toFixed(2) + " % d'eau"
} else {
text += (value * 100).toFixed(2) + "% d'eau"
text += (value * 100).toFixed(2) + " % d'eau"
}
}
}
......@@ -238,7 +238,7 @@ const monthlyReportNotification = async ({
const date = DateTime.local()
.setZone('utc', { keepLocalTime: true })
.minus({ month: 2 })
.minus({ month: 1 })
const template = monthlyReportTemplate({
title: 'Du nouveau dans votre espace Ecolyo !',
......@@ -268,7 +268,7 @@ const monthlyReportNotification = async ({
const mailData = {
mode: 'noreply',
subject: '[Ecolyo] - Votre bilan mensuel',
subject: `[Ecolyo] - Votre bilan mensuel du ${date.month}-${date.year}`,
parts: [
{
type: 'text/html',
......
......@@ -118,5 +118,5 @@ export const getMonthName = (date: DateTime) => {
'novembre',
'décembre',
]
return monthNames[date.month]
return monthNames[date.month - 1]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment