Date/time and device type in quick report.

Fix - invalid campaign when one tried to unsubscribe from a test message before campaign was sent
This commit is contained in:
Tomas Bures 2019-09-05 15:51:17 +02:00
parent 2e4dc1bce4
commit b6ed5e56b9
4 changed files with 13 additions and 7 deletions

View file

@ -769,11 +769,9 @@ async function changeStatusByCampaignCidAndSubscriptionIdTx(tx, context, campaig
])
.first();
if (!message) {
throw new Error('Invalid campaign.');
if (message) { // If a test is send before the campaign is sent, the corresponding entry does not exists in campaign_messages. We ignore such situations as the subscriber gets unsubscribed anyway. We just don't account it to the campaign.
await _changeStatusByMessageTx(tx, context, message, campaignMessageStatus);
}
await _changeStatusByMessageTx(tx, context, message, campaignMessageStatus);
}