< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.WebApi.Email.MailgunEmailChangeNoticeSender
Assembly: ArturRios.Heimdall.WebApi
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Presentation/ArturRios.Heimdall.WebApi/Email/MailgunEmailChangeNoticeSender.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 36
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 3
Fully covered methods: 3
Total methods: 3
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Purpose()100%11100%
SendAsync(...)100%11100%

File(s)

/home/runner/work/heimdall-api/heimdall-api/src/Presentation/ArturRios.Heimdall.WebApi/Email/MailgunEmailChangeNoticeSender.cs

#LineLine coverage
 1using ArturRios.Heimdall.Command.Services;
 2using ArturRios.Messaging.Email;
 3
 4namespace 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>
 14public class MailgunEmailChangeNoticeSender(
 15    IEmailService emailService,
 16    ILogger<MailgunEmailChangeNoticeSender> logger)
 217    : MailgunSender(emailService, logger), IEmailChangeNoticeSender
 18{
 19    private const string Subject = "The email address on your account was changed";
 20
 221    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
 234        return DeliverAsync(previousEmail, Subject, body);
 35    }
 36}