mirror of
https://github.com/xtr-dev/payload-mailing.git
synced 2025-12-10 16:23:23 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c0f202518 | ||
| 3f177cfeb5 | |||
| e364dd2c58 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xtr-dev/payload-mailing",
|
"name": "@xtr-dev/payload-mailing",
|
||||||
"version": "0.4.10",
|
"version": "0.4.11",
|
||||||
"description": "Template-based email system with scheduling and job processing for PayloadCMS",
|
"description": "Template-based email system with scheduling and job processing for PayloadCMS",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
|||||||
@@ -182,9 +182,8 @@ export const sendEmail = async <TEmail extends BaseEmailDocument = BaseEmailDocu
|
|||||||
|
|
||||||
if (emailWithJobs.jobs && emailWithJobs.jobs.length > 0) {
|
if (emailWithJobs.jobs && emailWithJobs.jobs.length > 0) {
|
||||||
// Job found! Get the first job ID (should only be one for a new email)
|
// Job found! Get the first job ID (should only be one for a new email)
|
||||||
jobId = Array.isArray(emailWithJobs.jobs)
|
const firstJob = Array.isArray(emailWithJobs.jobs) ? emailWithJobs.jobs[0] : emailWithJobs.jobs
|
||||||
? String(emailWithJobs.jobs[0])
|
jobId = typeof firstJob === 'string' ? firstJob : String(firstJob.id || firstJob)
|
||||||
: String(emailWithJobs.jobs)
|
|
||||||
logger.info(`Found job ID: ${jobId}`)
|
logger.info(`Found job ID: ${jobId}`)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user