| | | 1 | | using ArturRios.Heimdall.Command.Services; |
| | | 2 | | using ArturRios.Messaging.Email; |
| | | 3 | | |
| | | 4 | | namespace ArturRios.Heimdall.WebApi.Email; |
| | | 5 | | |
| | | 6 | | /// <summary> |
| | | 7 | | /// Delivers UC-08's email-change notice to the previous address through Mailgun (FR-PE-15). A |
| | | 8 | | /// failure is logged by <see cref="MailgunSender" /> and never propagated: the change has been |
| | | 9 | | /// made, and failing the response would not undo it. |
| | | 10 | | /// </summary> |
| | | 11 | | /// <remarks> |
| | | 12 | | /// The body names neither the new address nor any link. See <see cref="IEmailChangeNoticeSender" />. |
| | | 13 | | /// </remarks> |
| | | 14 | | public class MailgunEmailChangeNoticeSender( |
| | | 15 | | IEmailService emailService, |
| | | 16 | | ILogger<MailgunEmailChangeNoticeSender> logger) |
| | 2 | 17 | | : MailgunSender(emailService, logger), IEmailChangeNoticeSender |
| | | 18 | | { |
| | | 19 | | private const string Subject = "The email address on your account was changed"; |
| | | 20 | | |
| | 2 | 21 | | protected override string Purpose => "email change notice"; |
| | | 22 | | |
| | | 23 | | public Task SendAsync(string previousEmail) |
| | | 24 | | { |
| | | 25 | | const string body = """ |
| | | 26 | | The email address on your account was changed, and this address no longer |
| | | 27 | | receives its messages. |
| | | 28 | | |
| | | 29 | | If you made this change, you do not need to do anything. |
| | | 30 | | |
| | | 31 | | If you did not, contact an administrator straight away. |
| | | 32 | | """; |
| | | 33 | | |
| | 2 | 34 | | return DeliverAsync(previousEmail, Subject, body); |
| | | 35 | | } |
| | | 36 | | } |