Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit 609cd18

Browse files
committed
Refactoring Logger
1 parent 8a7ade0 commit 609cd18

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/NET6CustomLibrary/MailKit/Services/MailKitEmailSender.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
public class MailKitEmailSender : IEmailClient
44
{
5-
private readonly ILoggerService loggerService;
5+
private readonly ILoggerService logger;
66
private readonly IOptionsMonitor<SmtpOptions> smtpOptionsMonitor;
77

8-
public MailKitEmailSender(ILoggerService loggerService, IOptionsMonitor<SmtpOptions> smtpOptionsMonitor)
8+
public MailKitEmailSender(ILoggerService logger, IOptionsMonitor<SmtpOptions> smtpOptionsMonitor)
99
{
10-
this.loggerService = loggerService;
10+
this.logger = logger;
1111
this.smtpOptionsMonitor = smtpOptionsMonitor;
1212
}
1313

@@ -50,12 +50,12 @@ public async Task<bool> SendEmailAsync(string recipientEmail, string replyToEmai
5050
await client.SendAsync(message, token);
5151
await client.DisconnectAsync(true, token);
5252

53-
loggerService.SaveLogInformation($"Message successfully sent to the email address {recipientEmail}");
53+
logger.SaveLogInformation($"Message successfully sent to the email address {recipientEmail}");
5454
return true;
5555
}
5656
catch
5757
{
58-
loggerService.SaveLogError($"Couldn't send email to {recipientEmail} with message {htmlMessage}");
58+
logger.SaveLogError($"Couldn't send email to {recipientEmail} with message {htmlMessage}");
5959
return false;
6060
}
6161
}

0 commit comments

Comments
 (0)