-
Notifications
You must be signed in to change notification settings - Fork 138
Implement an Outbox for Emails #758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideThis PR replaces immediate asynchronous email dispatch with a persistent outbox queue: it introduces a QueuedMail model, enqueues messages per order and attendee using the new model, and adds outbox management views, URLs, templates, and navigation to review, send, or purge queued mails. Sequence diagram for email queuing in the new outbox flowsequenceDiagram
actor Admin
participant SenderView
participant QueuedMail
participant DB as Database
Admin->>SenderView: Submit email form
SenderView->>QueuedMail: Create QueuedMail for each recipient
QueuedMail->>DB: Save QueuedMail instance(s)
SenderView-->>Admin: Show success message
Sequence diagram for sending all queued emails from the outboxsequenceDiagram
actor Admin
participant OutboxListView
participant QueuedMail
participant DB as Database
Admin->>OutboxListView: Click 'Send all' button
OutboxListView->>QueuedMail: Fetch unsent mails
loop For each unsent mail
OutboxListView->>QueuedMail: send()
QueuedMail->>DB: Update sent, sent_at
end
OutboxListView-->>Admin: Show result message
ER diagram for QueuedMail and related entitieserDiagram
QUEUEDMAIL ||--o{ EVENT : event
QUEUEDMAIL }o--|| USER : user
QUEUEDMAIL ||--o{ ORDER : order
QUEUEDMAIL }o--|| ORDERPOSITION : position
QUEUEDMAIL {
bigint id PK
varchar recipient
text subject
text message
varchar reply_to
text bcc
varchar locale
json attachments
datetime created
boolean sent
datetime sent_at
}
Class diagram for the new QueuedMail modelclassDiagram
class QueuedMail {
+Event event
+User user
+Order order
+OrderPosition position
+str recipient
+str subject
+str message
+str reply_to
+str bcc
+str locale
+JSON attachments
+datetime created
+bool sent
+datetime sent_at
+make_text(signature)
+send(event_signature)
}
QueuedMail --> Event
QueuedMail --> User
QueuedMail --> Order
QueuedMail --> OrderPosition
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Thanks for this draft. Please ensure the following works as well:
|
|
@mariobehling Could you please clarify/elaborate more on the below:
|
|
@Gagan-Ram how about the handling multiple receivers? Is it going to be done today too? |
|
@Gagan-Ram I saw you opened a new PR for multiple receivers. Why is it still in draft mode? |
|
@hpdang Sorry I didn't notice your message, maybe it was cleared from my notification when I was clearing stale ones. |
|
I am closing this PR as the newer PR #780 is more aligned with the changes requested by maintainers. |



fixes: #658
Summary by Sourcery
Implement an email outbox system in the sendmail plugin by queuing emails in the database instead of sending them immediately.
New Features:
Enhancements: