Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ecolyo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
Ecolyo
Commits
64b52b7a
Commit
64b52b7a
authored
4 years ago
by
Yoan VALLET
Browse files
Options
Downloads
Patches
Plain Diff
feat: add send mail for test purpose
parent
6d16a17f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!103
Support
,
!102
Dev
,
!83
Features/113 bilan mensuel
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
manifest.webapp
+1
-1
1 addition, 1 deletion
manifest.webapp
src/targets/services/monthlySummary.js
+19
-0
19 additions, 0 deletions
src/targets/services/monthlySummary.js
with
20 additions
and
1 deletion
manifest.webapp
+
1
−
1
View file @
64b52b7a
...
...
@@ -21,7 +21,7 @@
"public": false
}
},
"service": {
"service
s
": {
"monthlySummary": {
"type": "node",
"file": "monthlySummary.js",
...
...
This diff is collapsed.
Click to expand it.
src/targets/services/monthlySummary.js
+
19
−
0
View file @
64b52b7a
...
...
@@ -50,6 +50,25 @@ const monthlySummaryStats = async () => {
const
consumptions
=
await
fetchConsumptionsForPeriod
(
period
)
const
meanConsumptions
=
getMeanOnPeriod
(
consumptions
,
period
)
const
FEEDBACK_EMAIL
=
'
ecolyo@grandlyon.com
'
const
mailContent
=
'
TEST
'
const
mailData
=
{
mode
:
'
from
'
,
to
:
[{
name
:
'
Support
'
,
email
:
FEEDBACK_EMAIL
}],
subject
:
'
[Ecolyo] - Votre bilan mensuel
'
,
parts
:
[{
type
:
'
text/plain
'
,
body
:
mailContent
}],
}
try
{
const
jobCollection
=
client
.
collection
(
'
io.cozy.jobs
'
)
await
jobCollection
.
create
(
'
sendmail
'
,
mailData
)
}
catch
(
e
)
{
// eslint-disable-next-line no-console
console
.
error
(
e
)
setError
(
t
(
'
feedback.error_sending
'
))
}
log
(
'
info
'
,
`
${
consumptions
.
length
}
consumptions between
${
period
.
start
}
and
${
period
.
end
}
`
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment