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
@@ -76,11 +76,16 @@ func (notifier *InvitationNotifier) InvitationDelivered(ctx context.Context, uni
|
||||
if err := unit.Outbox().Append(ctx, event); err != nil {
|
||||
return fmt.Errorf("%s - append event: %w", location, err)
|
||||
}
|
||||
subject, err := domain.NewInvitationMailSubject(invitation.ID(), invitation.OrganizationID())
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s - name invitation: %w", location, err)
|
||||
}
|
||||
if _, err := notifier.mail.RequestNotification(ctx, unit, NotificationRequest{
|
||||
RecipientUserID: invitation.CandidateID(),
|
||||
Notification: mailtemplate.NotificationData{
|
||||
Subject: invitationMailSubject, Body: invitationMailBody, LinkPath: candidateInvitationsPath,
|
||||
},
|
||||
Subject: subject,
|
||||
}); err != nil {
|
||||
return fmt.Errorf("%s - request email: %w", location, err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user