Skip to content
Snippets Groups Projects
Commit 377dc0b4 authored by Rémi PAPIN's avatar Rémi PAPIN
Browse files

Add montlyReport mail

parent 7dbf979f
Branches
Tags
1 merge request!120Add montlyReport mail
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
"monthlyReport": { "monthlyReport": {
"type": "node", "type": "node",
"file": "services/monthlyReport/ecolyo.js", "file": "services/monthlyReport/ecolyo.js",
"trigger": "@cron 0 0 * * * *" "trigger": "@cron 0 0 3 * *"
} }
}, },
"permissions": { "permissions": {
......
This diff is collapsed.
This diff is collapsed.
...@@ -105,13 +105,14 @@ const monthlyReport = async ({ client }: MonthlyReportProps) => { ...@@ -105,13 +105,14 @@ const monthlyReport = async ({ client }: MonthlyReportProps) => {
} }
log('info', 'Creation of mail...') log('info', 'Creation of mail...')
const mailContent = createEmail( const mailService = new MailService()
username, // const mailContent = createEmail(
url, // username,
periodLabel, // url,
monthlyPerformance // periodLabel,
) // monthlyPerformance
// )
const mailContent = mailService.CreateBodyMonthlyReport(username, url)
const mailData = { const mailData = {
mode: 'noreply', mode: 'noreply',
subject: '[Ecolyo] - Votre bilan mensuel', subject: '[Ecolyo] - Votre bilan mensuel',
...@@ -123,7 +124,6 @@ const monthlyReport = async ({ client }: MonthlyReportProps) => { ...@@ -123,7 +124,6 @@ const monthlyReport = async ({ client }: MonthlyReportProps) => {
], ],
} }
log('info', 'Sending mail...') log('info', 'Sending mail...')
const mailService = new MailService()
mailService.SendMail(client, mailData) mailService.SendMail(client, mailData)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment