Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xpub-epmc
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
Literature-services
public-projects
xpub-epmc
Commits
6b269fb7
Commit
6b269fb7
authored
6 years ago
by
ahamelers
Browse files
Options
Downloads
Patches
Plain Diff
add system bcc to system emails
parent
746e95fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!75
Shared data model
,
!77
Dev
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/default.js
+2
-1
2 additions, 1 deletion
config/default.js
server/email/index.js
+16
-11
16 additions, 11 deletions
server/email/index.js
with
18 additions
and
12 deletions
config/default.js
+
2
−
1
View file @
6b269fb7
...
...
@@ -164,7 +164,8 @@ module.exports = {
url
:
process
.
env
.
PUBSWEET_URL
||
'
http://localhost:3000/
'
,
sender
:
process
.
env
.
PUBSWEET_SENDER
||
'
helpdesk@europepmc.org
'
,
testAddress
:
process
.
env
.
PUBSWEET_TEST_EMAIL
||
'
plusdev@ebi.ac.uk
'
,
// change 'plusdev@ebi.ac.uk' to blank string for production
// remove PUBSWEET_TEST_EMAIL and change 'plusdev@ebi.ac.uk' to blank string for production
system
:
process
.
env
.
PUBSWEET_SYSTEM_EMAIL
||
'
plusadmin@ebi.ac.uk
'
,
},
'
pubsweet-component-ink-backend
'
:
{
inkEndpoint
:
...
...
This diff is collapsed.
Click to expand it.
server/email/index.js
+
16
−
11
View file @
6b269fb7
...
...
@@ -13,18 +13,23 @@ const {
finalReviewTemplate
,
}
=
require
(
'
./templates
'
)
const
{
sender
,
url
,
testAddress
}
=
config
[
'
epmc-email
'
]
const
{
sender
,
url
,
testAddress
,
system
}
=
config
[
'
epmc-email
'
]
const
sendMail
=
(
to
,
subject
,
message
,
from
=
null
,
cc
=
null
)
=>
{
logger
.
info
(
`Email recipient:
${
to
}
`
)
const
sendMail
=
(
to
,
subject
,
message
,
from
=
null
,
cc
=
null
,
bcc
=
null
)
=>
{
const
mailData
=
{
from
:
from
||
sender
,
to
:
testAddress
||
to
,
subject
:
`[Europe PMC plus]
${
subject
}
`
,
html
:
htmlEmailBase
(
message
,
url
),
}
logger
.
info
(
`Email recipient:
${
to
}
`
)
if
(
cc
)
{
mailData
.
cc
=
testAddress
||
cc
logger
.
info
(
`Email CC:
${
cc
}
`
)
}
if
(
bcc
)
{
mailData
.
bcc
=
testAddress
||
bcc
logger
.
info
(
`Email BCC:
${
bcc
}
`
)
}
Email
.
send
(
mailData
)
}
...
...
@@ -41,14 +46,14 @@ const userMessage = (email, subject, message, from = null) => {
const
taggerEmail
=
(
email
,
manId
,
title
,
link
)
=>
{
const
html
=
newPackageForTaggingTemplate
(
manId
,
title
,
link
)
sendMail
(
email
,
'
New Package Available for Tagging
'
,
html
)
const
subject
=
'
New Package Available for Tagging
'
sendMail
(
email
,
subject
,
html
,
null
,
null
,
system
)
}
const
bulkUploaderEmail
=
(
email
,
message
)
=>
{
const
html
=
bulkUploadTemplate
(
message
)
sendMail
(
email
,
'
Error while processing package
'
,
html
)
const
subject
=
'
Error while processing package
'
sendMail
(
email
,
subject
,
html
,
null
,
null
,
system
)
}
const
reviewerEmail
=
({
reviewer
,
manInfo
,
submitter
,
token
})
=>
{
...
...
@@ -67,7 +72,7 @@ const reviewerEmail = ({ reviewer, manInfo, submitter, token }) => {
html
=
newReviewerTemplate
(
salutation
,
manInfo
.
title
,
submitterName
,
link
)
}
const
subject
=
`Approve submission of
${
manInfo
.
id
}
`
sendMail
(
reviewer
.
email
,
subject
,
html
)
sendMail
(
reviewer
.
email
,
subject
,
html
,
null
,
null
,
system
)
}
const
submitterRejectEmail
=
({
reviewer
,
manInfo
,
submitter
,
message
})
=>
{
...
...
@@ -85,7 +90,7 @@ const submitterRejectEmail = ({ reviewer, manInfo, submitter, message }) => {
link
,
)
const
subject
=
`
${
manInfo
.
id
}
: Submission rejected`
sendMail
(
email
,
subject
,
html
)
sendMail
(
email
,
subject
,
html
,
null
,
null
,
system
)
}
const
removeDuplicateEmail
=
(
user
,
badInfo
,
goodInfo
)
=>
{
...
...
@@ -105,7 +110,7 @@ const removeDuplicateEmail = (user, badInfo, goodInfo) => {
pmcid
,
)
const
subject
=
`
${
badInfo
.
id
}
: Duplicate submission`
sendMail
(
email
,
subject
,
html
)
sendMail
(
email
,
subject
,
html
,
null
,
null
,
system
)
}
const
finalReviewEmail
=
(
reviewer
,
manInfo
)
=>
{
...
...
@@ -126,7 +131,7 @@ const finalReviewEmail = (reviewer, manInfo) => {
releaseDelay
,
)
const
subject
=
`
${
manInfo
.
id
}
: Ready for final review`
sendMail
(
email
,
subject
,
html
)
sendMail
(
email
,
subject
,
html
,
null
,
null
,
system
)
}
module
.
exports
=
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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