rm some deps

This commit is contained in:
Collin M. Barrett 2019-05-02 06:48:56 -05:00
parent 51d294056a
commit bea6d0dafe
4 changed files with 0 additions and 41 deletions

View file

@ -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>

View file

@ -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);
}
}
}

View file

@ -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>

View file

@ -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>