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
ed9d8945
Commit
ed9d8945
authored
6 years ago
by
Audrey Hamelers
Browse files
Options
Downloads
Patches
Plain Diff
#422
parent
aa92bb83
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!112
Shared data model
,
!113
Dev
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/email/index.js
+14
-10
14 additions, 10 deletions
server/email/index.js
with
14 additions
and
10 deletions
server/email/index.js
+
14
−
10
View file @
ed9d8945
const
config
=
require
(
'
config
'
)
const
Email
=
require
(
'
@pubsweet/component-send-email
'
)
const
lodash
=
require
(
'
lodash
'
)
const
logger
=
require
(
'
@pubsweet/logger
'
)
const
{
htmlEmailBase
,
...
...
@@ -19,6 +20,8 @@ const {
const
tagger
=
config
.
ftp_tagger
.
email
const
{
sender
,
url
,
testAddress
,
system
,
dev
}
=
config
[
'
epmc-email
'
]
const
parsed
=
string
=>
lodash
.
unescape
(
string
)
const
sendMail
=
(
to
,
subject
,
message
,
from
=
null
,
cc
=
null
,
bcc
=
null
)
=>
{
const
mailData
=
{
from
:
from
||
sender
,
...
...
@@ -54,13 +57,13 @@ const taggerErrorEmail = (subject, message) => {
}
const
taggerEmail
=
(
email
,
manId
,
title
,
link
)
=>
{
const
html
=
newPackageForTaggingTemplate
(
manId
,
title
,
link
)
const
html
=
newPackageForTaggingTemplate
(
manId
,
parsed
(
title
)
,
link
)
const
subject
=
'
New Package Available for Tagging
'
sendMail
(
email
,
subject
,
html
,
null
,
null
,
system
)
}
const
processedTaggerEmail
=
(
email
,
manId
,
title
,
packageName
)
=>
{
const
html
=
processedTaggingFilesTemplate
(
manId
,
title
,
packageName
)
const
html
=
processedTaggingFilesTemplate
(
manId
,
parsed
(
title
)
,
packageName
)
const
subject
=
'
Tagging files have been uploaded
'
sendMail
(
email
,
subject
,
html
,
null
,
null
,
system
)
}
...
...
@@ -88,15 +91,16 @@ const reviewerEmail = ({ reviewer, manInfo, submitter, token }) => {
const
submitterName
=
`
${
title
?
`
${
title
}
`
:
''
}${
givenNames
}
${
surname
}
`
const
{
title
:
t
,
givenNames
:
g
,
surname
:
s
}
=
reviewer
.
name
const
salutation
=
`
${
t
?
`
${
t
}
`
:
''
}${
g
}
${
s
}
`
let
link
=
`
${
url
}
submission/
${
manInfo
.
id
}
/submit`
const
link
=
`
${
url
}
submission/
${
manInfo
.
id
}
/submit`
const
args
=
[
salutation
,
parsed
(
manInfo
.
title
),
submitterName
,
link
]
let
html
=
''
if
(
token
===
'
correction
'
)
{
html
=
checkReviewerTemplate
(
salutation
,
manInfo
.
title
,
submitterName
,
link
)
html
=
checkReviewerTemplate
(
...
args
)
}
else
if
(
reviewer
.
id
)
{
html
=
setReviewerTemplate
(
salutation
,
manInfo
.
title
,
submitterName
,
link
)
html
=
setReviewerTemplate
(
...
args
)
}
else
{
link
=
`
${
url
}
dashboard?accept=
${
token
}
`
html
=
newReviewerTemplate
(
salutation
,
manInfo
.
title
,
submitterName
,
link
)
args
[
4
]
=
`
${
url
}
dashboard?accept=
${
token
}
`
html
=
newReviewerTemplate
(
...
args
)
}
const
subject
=
`Approve submission of
${
manInfo
.
id
}
`
sendMail
(
reviewer
.
email
,
subject
,
html
,
null
,
null
,
system
)
...
...
@@ -111,7 +115,7 @@ const submitterRejectEmail = ({ reviewer, manInfo, submitter, message }) => {
const
link
=
`
${
url
}
submission/
${
manInfo
.
id
}
/submit`
const
html
=
rejectSubmissionTemplate
(
salutation
,
manInfo
.
title
,
parsed
(
manInfo
.
title
)
,
reviewerName
,
message
,
link
,
...
...
@@ -132,7 +136,7 @@ const removeDuplicateEmail = (user, badInfo, goodInfo) => {
const
html
=
removeDupeTemplate
(
salutation
,
badInfo
.
id
,
badInfo
[
'
meta,title
'
],
parsed
(
badInfo
[
'
meta,title
'
]
)
,
goodInfo
.
id
,
pmcid
,
)
...
...
@@ -153,7 +157,7 @@ const finalReviewEmail = (reviewer, manInfo) => {
}
`
const
html
=
finalReviewTemplate
(
salutation
,
manInfo
.
title
,
parsed
(
manInfo
.
title
)
,
link
,
releaseDelay
,
)
...
...
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