Skip to content

Commit

Permalink
Adding SendGrid Extension (#516)
Browse files Browse the repository at this point in the history
* Adding SendGrid Extension

* Addressed PR feedback
  • Loading branch information
soninaren authored Jun 25, 2021
1 parent a69fdd4 commit b206739
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
7 changes: 7 additions & 0 deletions DotNetWorker.sln
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.RabbitMQ"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.SignalRService", "extensions\Worker.Extensions.SignalRService\Worker.Extensions.SignalRService.csproj", "{A9802FBA-CF59-462B-88A0-1D7D0D19C748}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.SendGrid", "extensions\Worker.Extensions.SendGrid\Worker.Extensions.SendGrid.csproj", "{59EB5B01-4756-48BB-8B37-70D29E3BDFB6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.Warmup", "extensions\Worker.Extensions.Warmup\Worker.Extensions.Warmup.csproj", "{BDA0BCB4-BD26-4B10-B865-87082F290B38}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.Kafka", "extensions\Worker.Extensions.Kafka\Worker.Extensions.Kafka.csproj", "{F63A63A9-FE09-4225-A293-6A58F9C1E520}"
Expand Down Expand Up @@ -219,6 +221,10 @@ Global
{035AAD56-5F51-476C-8556-0F6CFD6EF1BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{035AAD56-5F51-476C-8556-0F6CFD6EF1BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{035AAD56-5F51-476C-8556-0F6CFD6EF1BF}.Release|Any CPU.Build.0 = Release|Any CPU
{59EB5B01-4756-48BB-8B37-70D29E3BDFB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59EB5B01-4756-48BB-8B37-70D29E3BDFB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59EB5B01-4756-48BB-8B37-70D29E3BDFB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59EB5B01-4756-48BB-8B37-70D29E3BDFB6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -257,6 +263,7 @@ Global
{2A72383A-9C00-41FB-9D29-909EE5E6BFB9} = {9D6603BD-7EA2-4D11-A69C-0D9E01317FD6}
{C4C0CE7E-6A34-473E-A8FB-7D8FBA765779} = {9D6603BD-7EA2-4D11-A69C-0D9E01317FD6}
{035AAD56-5F51-476C-8556-0F6CFD6EF1BF} = {9D6603BD-7EA2-4D11-A69C-0D9E01317FD6}
{59EB5B01-4756-48BB-8B37-70D29E3BDFB6} = {A7B4FF1E-3DF7-4F28-9333-D0961CDDF702}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {497D2ED4-A13E-4BCA-8D29-F30CA7D0EA4A}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using Microsoft.Azure.Functions.Worker.Extensions.Abstractions;

[assembly: ExtensionInformation("Microsoft.Azure.WebJobs.Extensions.SendGrid", "3.0.2")]
47 changes: 47 additions & 0 deletions extensions/Worker.Extensions.SendGrid/SendGridAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using Microsoft.Azure.Functions.Worker.Extensions.Abstractions;

namespace Microsoft.Azure.Functions.Worker
{
/// <summary>
/// Initializes a new instance of the <see cref="SendGridOutputAttribute"/> class.
/// </summary>
public sealed class SendGridOutputAttribute : OutputBindingAttribute
{
/// <summary>
/// Initialize a new instance of the <see cref="SendGridOutputAttribute"/>
/// </summary>
public SendGridOutputAttribute()
{
}

/// <summary>
/// Gets or sets an optional string value indicating the app setting to use as the SendGrid API key,
/// if different than the one specified in the <see cref="SendGrid.SendGridClientOptions"/>.
/// </summary>
public string? ApiKey { get; set; }

/// <summary>
/// Gets or sets the message "To" field. May include binding parameters.
/// </summary>
public string? To { get; set; }

/// <summary>
/// Gets or sets the message "From" field. May include binding parameters.
/// </summary>
public string? From { get; set; }

/// <summary>
/// Gets or sets the message "Subject" field. May include binding parameters.
/// </summary>
public string? Subject { get; set; }

/// <summary>
/// Gets or sets the message "Text" field. May include binding parameters.
/// </summary>
public string? Text { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>Microsoft.Azure.Functions.Worker.Extensions.SendGrid</AssemblyName>
<RootNamespace>Microsoft.Azure.Functions.Worker.Extensions.SendGrid</RootNamespace>
<Description>Azure SendGrid extension for .NET isolated functions</Description>

<!--Version information-->
<VersionPrefix>3.0.2</VersionPrefix>

<!--Temporarily opting out of documentation. Pending documentation-->
<GenerateDocumentationFile>false</GenerateDocumentationFile>
</PropertyGroup>

<Import Project="..\..\build\Extensions.props" />

<ItemGroup>
<ProjectReference Include="..\Worker.Extensions.Abstractions\Worker.Extensions.Abstractions.csproj" />
</ItemGroup>

</Project>

0 comments on commit b206739

Please sign in to comment.