OLT.Email.SendGrid
6.2.0
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package OLT.Email.SendGrid --version 6.2.0
NuGet\Install-Package OLT.Email.SendGrid -Version 6.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OLT.Email.SendGrid" Version="6.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OLT.Email.SendGrid" Version="6.2.0" />
<PackageReference Include="OLT.Email.SendGrid" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OLT.Email.SendGrid --version 6.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OLT.Email.SendGrid, 6.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OLT.Email.SendGrid@6.2.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OLT.Email.SendGrid&version=6.2.0
#tool nuget:?package=OLT.Email.SendGrid&version=6.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SendGrid Builder pattern that introduces a whitelist
The goal was to allow email processes to run in a test environment and only send to domains and/or email addresses in a whitelist. Production environments would ignore the whitelist and send it to all recipients
Template with Data
var templateId = "d-valuefromsendgrid";
var templateData = new MyTemplateDataClass(); //Contains data tha will serialize to JSON and bind to template
var fromEmail = new OltEmailAddress
{
Name = "My Company Name",
Email = "no-reply@mycompany.com",
};
var whitelist = new OltEmailConfigurationWhitelist
{
Email = new List<string> { "someemail@email.com", "anotherperson@fake.com" },
Domain = new List<string> { "google.com", "microsoft.com" }, //Any email that ends with domain name will send in non-prod environments
};
var recipients = new OltEmailRecipients
{
To = new List<IOltEmailAddress>
{
new OltEmailAddress
{
Name = "Name Here"
Email = "someemail@email.com"
}
},
CarbonCopy = new List<IOltEmailAddress>
{
new OltEmailAddress
{
Name = "Another Name Here"
Email = "someemail@email.com"
}
}
};
var client = new OltSendGridClient()
.WithFromEmail(fromEmail)
.WithApiKey(_config.ApiKey)
.WithWhitelist(whitelist)
.WithTemplate(templateId, templateData)
.WithRecipients(recipients)
.WithCustomArg("email_uid", uid)
.WithCustomArg("some_internal_id", internalId)
//1) false will only send to whitelist domains or email addresses
//2) true will ignore whitelist and send all emails.
//3) typically controlled via config/environment variable
.EnableProductionEnvironment(false);
resultAsync = await client.SendAsync();
Template with No Data
var templateId = "d-valuefromsendgrid";
var whitelist = new OltEmailConfigurationWhitelist
{
Email = new List<string> { "someemail@email.com", "anotherperson@fake.com" },
Domain = new List<string> { "google.com", "microsoft.com" }, //Any email that ends with domain name will send in non-prod environments
};
var recipients = new OltEmailRecipients
{
To = new List<IOltEmailAddress>
{
new OltEmailAddress
{
Name = "Name Here"
Email = "someemail@email.com"
}
}
};
var client = new OltSendGridClient()
.WithFromEmail("no-reply@mycompany.com", "Company Name")
.WithApiKey(_config.ApiKey)
.WithWhitelist(whitelist)
.WithTemplate(templateId) // <----- Just send the templateId
.WithRecipients(recipients)
.EnableProductionEnvironment(true); // <---- This will send all emails ignoring the whitelist
resultAsync = await client.SendAsync();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.Extensions.Options (>= 6.0.0)
- OLT.Email.SendGrid.Shared (>= 6.2.0)
- SendGrid (>= 9.27.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
8.0.0 | 197 | 2/21/2024 |
8.0.0-beta-0030 | 135 | 2/19/2024 |
8.0.0-beta-0025 | 154 | 1/15/2024 |
8.0.0-beta-0020 | 118 | 1/15/2024 |
8.0.0-beta-0015 | 164 | 12/29/2023 |
8.0.0-beta-0010 | 154 | 12/20/2023 |
8.0.0-beta-0005 | 168 | 12/9/2023 |
7.2.0 | 264 | 12/8/2023 |
7.2.0-beta-0007 | 136 | 12/8/2023 |
7.2.0-beta-0005 | 137 | 12/8/2023 |
7.1.0 | 201 | 10/23/2023 |
7.1.0-beta-0015 | 203 | 7/28/2023 |
7.1.0-beta-0013 | 191 | 6/28/2023 |
7.1.0-beta-0011 | 174 | 6/25/2023 |
7.1.0-beta-0006 | 188 | 6/24/2023 |
7.1.0-beta-0003 | 169 | 6/24/2023 |
7.1.0-beta-0002 | 186 | 6/24/2023 |
7.1.0-beta-0001 | 194 | 5/31/2023 |
7.0.3 | 187 | 9/25/2023 |
7.0.2 | 227 | 7/27/2023 |
7.0.1 | 247 | 7/26/2023 |
7.0.0 | 281 | 4/20/2023 |
7.0.0-beta-0010 | 208 | 4/5/2023 |
7.0.0-beta-0008 | 217 | 2/26/2023 |
7.0.0-beta-0005 | 209 | 2/12/2023 |
7.0.0-beta-0003 | 229 | 1/29/2023 |
7.0.0-beta-0001 | 226 | 1/29/2023 |
6.8.0 | 411 | 2/11/2023 |
6.8.0-beta-0003 | 196 | 2/11/2023 |
6.8.0-beta-0001 | 224 | 1/29/2023 |
6.7.2 | 406 | 1/29/2023 |
6.7.1 | 401 | 12/20/2022 |
6.7.0 | 398 | 12/17/2022 |
6.6.0 | 417 | 12/2/2022 |
6.5.4 | 422 | 11/23/2022 |
6.5.3 | 430 | 11/23/2022 |
6.5.2 | 420 | 11/14/2022 |
6.5.1 | 515 | 10/19/2022 |
6.5.0 | 508 | 10/3/2022 |
6.4.3 | 482 | 9/28/2022 |
6.4.2 | 525 | 9/26/2022 |
6.4.1 | 524 | 9/18/2022 |
6.4.0 | 513 | 8/31/2022 |
6.3.5 | 520 | 8/12/2022 |
6.3.4 | 547 | 7/25/2022 |
6.3.3 | 552 | 7/22/2022 |
6.3.2 | 610 | 7/11/2022 |
6.3.1 | 564 | 7/2/2022 |
6.3.0 | 575 | 7/1/2022 |
6.2.1 | 567 | 6/15/2022 |
6.2.0 | 564 | 6/2/2022 |
6.1.1 | 597 | 5/12/2022 |
6.1.0 | 559 | 5/1/2022 |
6.0.6 | 597 | 4/6/2022 |
6.0.5 | 592 | 4/4/2022 |
6.0.4 | 586 | 4/2/2022 |
6.0.3 | 620 | 4/1/2022 |
6.0.2 | 618 | 3/31/2022 |
6.0.1 | 593 | 3/25/2022 |
6.0.0 | 590 | 3/24/2022 |
6.0.0-beta-0035 | 281 | 3/17/2022 |
6.0.0-beta-0030 | 265 | 3/15/2022 |
6.0.0-beta-0025 | 288 | 3/14/2022 |
6.0.0-beta-0015 | 284 | 3/8/2022 |
6.0.0-beta-0011 | 295 | 3/6/2022 |
6.0.0-beta-0010 | 293 | 3/4/2022 |
6.0.0-beta-0004 | 280 | 2/28/2022 |
6.0.0-beta-0003 | 291 | 2/27/2022 |
6.0.0-beta-0002 | 287 | 2/25/2022 |
6.0.0-beta-0001 | 289 | 2/24/2022 |
5.8.0 | 601 | 2/15/2022 |
5.7.0 | 591 | 1/26/2022 |
5.6.0 | 456 | 12/7/2021 |
5.5.0 | 711 | 12/4/2021 |
5.4.2 | 5,952 | 11/24/2021 |
5.4.1 | 532 | 11/17/2021 |
5.4.0 | 445 | 11/15/2021 |
5.3.3 | 455 | 11/9/2021 |
5.3.2 | 485 | 11/5/2021 |
5.3.1 | 521 | 10/28/2021 |
5.3.0 | 490 | 9/22/2021 |
5.2.6 | 476 | 9/16/2021 |
5.2.5 | 470 | 9/13/2021 |
5.2.4 | 475 | 9/3/2021 |
5.2.3 | 449 | 8/31/2021 |
5.2.2 | 502 | 8/27/2021 |
5.2.1 | 445 | 8/25/2021 |
5.2.0 | 552 | 8/15/2021 |
5.1.4 | 515 | 7/8/2021 |
5.1.0 | 505 | 5/4/2021 |