feat(notifications): send product notifications with a rights check right before each send
This commit is contained in:
1 parent
a856066316
commit
623d41b969
59 files changed
+4125
-1126
No files matched your search
@@ -109,10 +109,13 @@ func (renderer TemplateRenderer) RenderPasswordReset(data mailtemplate.PasswordR
|
||||
return content, nil
|
||||
}
|
||||
|
||||
// NotificationRequest asks for one notification mail to one account.
|
||||
// NotificationRequest asks for one notification mail to one account. Subject
|
||||
// names the record the notice concerns, whose rights are checked before the
|
||||
// send; the zero value names none.
|
||||
type NotificationRequest struct {
|
||||
RecipientUserID uuid.UUID
|
||||
Notification mailtemplate.NotificationData
|
||||
Subject domain.MailSubject
|
||||
}
|
||||
|
||||
// MailRequester records mail requests in the caller's transaction.
|
||||
@@ -154,6 +157,7 @@ func (requester *MailRequester) RequestNotification(ctx context.Context, unit ou
|
||||
Body: request.Notification.Body,
|
||||
LinkPath: request.Notification.LinkPath,
|
||||
},
|
||||
Subject: request.Subject,
|
||||
CreatedAt: requester.clock(),
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user