CoolCMS API

InvoiceEmailState : string
in package

Result of sending an invoice by e-mail: three states, not two.

Delivery (or queueing) is an external effect outside the database transaction, and the manual send goes through the admin HTTP bridge, so "sent" and "audit written" cannot be made atomic. Folding this into one boolean would report the partial state as success or as a plain failure, and in both cases the admin sends the e-mail again.

Table of Contents

Cases

NotSent  = 'notSent'
Not delivered or queued; the audit write was not even attempted.
Sent  = 'sent'
Sent and recorded (`emailIsSent` etc.); full success.
SentNotRecorded  = 'sentNotRecorded'
IMPORTANT: sent, but the audit write failed. The recipient has the e-mail (or the queue will deliver it) while the invoice stays `emailIsSent = false`. It must be reported neither as success nor as not sent, otherwise the e-mail goes out a second time.

Cases

SentNotRecorded

IMPORTANT: sent, but the audit write failed. The recipient has the e-mail (or the queue will deliver it) while the invoice stays `emailIsSent = false`. It must be reported neither as success nor as not sent, otherwise the e-mail goes out a second time.

On this page

Search results