| | | 1 | | using ArturRios.Heimdall.Command.Services; |
| | | 2 | | using ArturRios.Messaging.Email; |
| | | 3 | | |
| | | 4 | | namespace ArturRios.Heimdall.WebApi.Email; |
| | | 5 | | |
| | | 6 | | /// <summary> |
| | | 7 | | /// Delivers the scope owner invitation notices through Mailgun (UC-21, UC-60, UC-61). A failure is logged |
| | | 8 | | /// by <see cref="MailgunSender" /> and never propagated: the invitation or its answer is already stored. |
| | | 9 | | /// </summary> |
| | | 10 | | public class MailgunScopeInvitationNoticeSender( |
| | | 11 | | IEmailService emailService, |
| | | 12 | | ILogger<MailgunScopeInvitationNoticeSender> logger) |
| | 5 | 13 | | : MailgunSender(emailService, logger), IScopeInvitationNoticeSender |
| | | 14 | | { |
| | 5 | 15 | | protected override string Purpose => "scope invitation notice"; |
| | | 16 | | |
| | | 17 | | public Task SendInvitationAsync(string inviteeEmail, string inviterName, string scopeName, DateTime expiresAt) => |
| | 3 | 18 | | DeliverAsync(inviteeEmail, ScopeInvitationNoticeText.InvitationSubject, |
| | 3 | 19 | | ScopeInvitationNoticeText.Invitation(inviterName, scopeName, expiresAt)); |
| | | 20 | | |
| | | 21 | | public Task SendAnswerAsync(string inviterEmail, string inviteeName, string scopeName, bool accepted) => |
| | 2 | 22 | | DeliverAsync(inviterEmail, ScopeInvitationNoticeText.AnswerSubject, |
| | 2 | 23 | | ScopeInvitationNoticeText.Answer(inviteeName, scopeName, accepted)); |
| | | 24 | | } |