We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51b6a5f commit 7e7c619Copy full SHA for 7e7c619
back/config/functions/cron.js
@@ -81,11 +81,18 @@ module.exports = {
81
`);
82
for (const actuality of actualities) {
83
try {
84
+ const writerEmail = actuality.updated_by ? actuality.updated_by.email : actuality.created_by ? actuality.created_by.email : null
85
+
86
if (!actuality.published_at) {
87
throw new Error('not_published');
88
}
89
90
const emails = [...new Set(users.rows.map(user => user.email))]
91
92
+ if (writerEmail) {
93
+ emails.push(writerEmail)
94
+ }
95
96
console.log(`Sending actuality ${actuality.id} email to ${emails.length} users`)
97
98
await strapi.services.actuality.sendActualityEmails({ ...actuality, image: actuality.image.id }, emails);
0 commit comments