mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
rm some deps
This commit is contained in:
parent
51d294056a
commit
bea6d0dafe
4 changed files with 0 additions and 41 deletions
|
|
@ -32,7 +32,6 @@
|
|||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="3.1.2" />
|
||||
<PackageReference Include="Microsoft.DotNet.Analyzers.Compatibility" Version="0.2.12-alpha" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.7.2" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using SendGrid;
|
||||
using SendGrid.Helpers.Mail;
|
||||
|
||||
namespace FilterLists.Services
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class EmailService
|
||||
{
|
||||
private readonly SendGridClient sendGridClient;
|
||||
private readonly EmailAddress fromEmailAddress;
|
||||
private readonly EmailAddress toEmailAddress;
|
||||
|
||||
public EmailService(IConfiguration configuration)
|
||||
{
|
||||
var sendGridConfig = configuration.GetSection("SendGrid");
|
||||
sendGridClient = new SendGridClient(sendGridConfig.GetValue<string>("ApiKey"));
|
||||
fromEmailAddress = new EmailAddress(sendGridConfig.GetSection("From").GetValue<string>("EmailAddress"),
|
||||
sendGridConfig.GetSection("From").GetValue<string>("Name"));
|
||||
toEmailAddress = new EmailAddress(sendGridConfig.GetSection("To").GetValue<string>("EmailAddress"),
|
||||
sendGridConfig.GetSection("To").GetValue<string>("Name"));
|
||||
}
|
||||
|
||||
public async Task SendEmailAsync(string subjectBody, string message)
|
||||
{
|
||||
var msg = new SendGridMessage
|
||||
{
|
||||
From = fromEmailAddress,
|
||||
Subject = "[FilterLists] " + subjectBody,
|
||||
PlainTextContent = message
|
||||
};
|
||||
msg.AddTo(toEmailAddress);
|
||||
await sendGridClient.SendEmailAsync(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -24,7 +24,6 @@
|
|||
<PackageReference Include="Microsoft.DotNet.Analyzers.Compatibility" Version="0.2.12-alpha" />
|
||||
<PackageReference Include="morelinq" Version="3.1.1" />
|
||||
<PackageReference Include="Octokit" Version="0.32.0" />
|
||||
<PackageReference Include="SendGrid" Version="9.11.0" />
|
||||
<PackageReference Include="SharpCompress" Version="0.23.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.6.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||
<PackageReference Include="Microsoft.DotNet.Analyzers.Compatibility" Version="0.2.12-alpha" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.7.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
Loading…
Reference in a new issue