fix ts error
This commit is contained in:
@@ -271,8 +271,16 @@ export async function sendCampaignEmail(
|
|||||||
// Queue emails
|
// Queue emails
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
emails.map((email) => {
|
emails.map((email) => {
|
||||||
const unsubscribeUrl = createUnsubUrl(email.contactId, campaignId);
|
let unsubscribeUrl = undefined;
|
||||||
EmailQueueService.queueEmail(email.id, domain.region, false, unsubscribeUrl);
|
if (email.contactId) {
|
||||||
|
unsubscribeUrl = createUnsubUrl(email.contactId, campaignId);
|
||||||
|
}
|
||||||
|
EmailQueueService.queueEmail(
|
||||||
|
email.id,
|
||||||
|
domain.region,
|
||||||
|
false,
|
||||||
|
unsubscribeUrl
|
||||||
|
);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user