Skip to content

Commit

Permalink
Add "using" to Mailgun sender
Browse files Browse the repository at this point in the history
  • Loading branch information
duckth committed Nov 5, 2024
1 parent c028dbd commit ee5db39
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions coffeecard/CoffeeCard.Library/Services/MailgunEmailSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ public class MailgunEmailSender(MailgunSettings mailgunSettings) : IEmailSender
{
public async Task SendEmailAsync(MimeMessage mail)
{
var client = new RestClient(mailgunSettings.MailgunApiUrl)
{
Authenticator = new HttpBasicAuthenticator("api", mailgunSettings.ApiKey)
};
using var client = new RestClient(mailgunSettings.MailgunApiUrl);
client.Authenticator = new HttpBasicAuthenticator("api", mailgunSettings.ApiKey);

var request = new RestRequest();
request.AddParameter("domain", mailgunSettings.Domain, ParameterType.UrlSegment);
Expand Down

0 comments on commit ee5db39

Please sign in to comment.