Commit 733f71c6 authored by Audrey Hamelers's avatar Audrey Hamelers
parent 329f618a
Pipeline #12953 passed with stages
in 5 minutes and 37 seconds
......@@ -28,7 +28,7 @@ async function taggingAlert() {
.whereNull('manuscript.deleted')
.distinct('a.manuscriptId')
if (tagging.length > 0) {
await sendMessage(tagging.length)
await sendMessage(tagging)
return true
}
logger.info('No manuscripts sent to tagging yesterday.')
......@@ -38,10 +38,12 @@ async function taggingAlert() {
return true
}
async function sendMessage(count) {
const message = `${count} manuscripts were sent for tagging yesterday.
Your team may QA up to ${count} manuscript submissions today.`
const subject = `${count} submissions sent for tagging`
async function sendMessage(list) {
const message = `${list.length} manuscript${
list.length === 1 ? ' was' : 's were'
} sent for tagging yesterday.\n
${list.map(m => m.manuscriptId).join('\n')}`
const subject = `${list.length} submissions sent for tagging`
await userMessage(externalQA, subject, message, null, null, system)
return true
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment