| | | 1 | | using ArturRios.Heimdall.Command.Services; |
| | | 2 | | using ArturRios.Heimdall.Shared.Security; |
| | | 3 | | |
| | | 4 | | namespace ArturRios.Heimdall.WebApi.Email; |
| | | 5 | | |
| | | 6 | | /// <summary> |
| | | 7 | | /// Fallback <see cref="IScopeInvitationNoticeSender" /> for environments without Mailgun, registered beside |
| | | 8 | | /// <see cref="LoggingEmailChangeNoticeSender" />. Logs a reference to the address, never the address itself |
| | | 9 | | /// or the names (NFR-22). |
| | | 10 | | /// </summary> |
| | 22 | 11 | | public class LoggingScopeInvitationNoticeSender(ILogger<LoggingScopeInvitationNoticeSender> logger) |
| | | 12 | | : IScopeInvitationNoticeSender |
| | | 13 | | { |
| | | 14 | | public Task SendInvitationAsync(string inviteeEmail, string inviterName, string scopeName, DateTime expiresAt) |
| | | 15 | | { |
| | 4 | 16 | | logger.LogInformation("Scope invitation notice for {EmailRef}", LogSafeEmail.Reference(inviteeEmail)); |
| | | 17 | | |
| | 4 | 18 | | return Task.CompletedTask; |
| | | 19 | | } |
| | | 20 | | |
| | | 21 | | public Task SendAnswerAsync(string inviterEmail, string inviteeName, string scopeName, bool accepted) |
| | | 22 | | { |
| | 3 | 23 | | logger.LogInformation( |
| | 3 | 24 | | "Scope invitation answer notice for {EmailRef} (accepted: {Accepted})", |
| | 3 | 25 | | LogSafeEmail.Reference(inviterEmail), accepted); |
| | | 26 | | |
| | 3 | 27 | | return Task.CompletedTask; |
| | | 28 | | } |
| | | 29 | | } |