net3000.sendgrid 1.0.0

dotnet add package net3000.sendgrid --version 1.0.0
                    
NuGet\Install-Package net3000.sendgrid -Version 1.0.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="net3000.sendgrid" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="net3000.sendgrid" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="net3000.sendgrid" />
                    
Project file
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 net3000.sendgrid --version 1.0.0
                    
#r "nuget: net3000.sendgrid, 1.0.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 net3000.sendgrid@1.0.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=net3000.sendgrid&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=net3000.sendgrid&version=1.0.0
                    
Install as a Cake Tool

Net3000.SendGrid

Overview

The Net3000.SendGrid library provides comprehensive integration with the SendGrid email delivery platform for Net3000 solutions. This library enables transactional email sending, email analytics, template management, and advanced email features using SendGrid's robust email infrastructure.

Features

  • Transactional Email: Send transactional emails with templates and dynamic content
  • Email Analytics: Track email delivery, opens, clicks, and engagement metrics
  • Template Management: Create and manage email templates
  • Contact Management: Manage subscriber lists and contact information
  • Event Webhooks: Handle SendGrid event webhooks for real-time email tracking
  • Advanced Features: Support for attachments, inline CSS, and personalization

Installation

dotnet add package net3000.sendgrid

Dependencies

  • net3000.common (v9.0.11)
  • SendGrid (v9.29.3)
  • Microsoft.Extensions.Configuration (v9.0.9)
  • Microsoft.EntityFrameworkCore (v9.0.9)
  • System.IdentityModel.Tokens.Jwt (v8.14.0)

Configuration

Add your SendGrid credentials to your configuration:

{
  "SendGrid": {
    "ApiKey": "your-sendgrid-api-key",
    "FromEmail": "noreply@example.com",
    "FromName": "Your Company Name",
    "DefaultTemplateId": "your-default-template-id"
  }
}

Usage

Basic Setup

using Net3000.SendGrid;

// Initialize the service
var sendGridService = new SendGridService(configuration);

Sending Emails

// Send a simple email
var emailResult = await sendGridService.SendEmailAsync(
    to: "recipient@example.com",
    subject: "Hello from Net3000",
    htmlContent: "<h1>Hello!</h1><p>This is a test email.</p>"
);

// Send email with template
var templateResult = await sendGridService.SendTemplateEmailAsync(
    to: "recipient@example.com",
    templateId: "your-template-id",
    dynamicData: new { name = "John Doe", company = "Example Corp" }
);

Email Analytics

// Get email statistics
var stats = await sendGridService.GetEmailStatsAsync(
    startDate: DateTime.Now.AddDays(-30),
    endDate: DateTime.Now
);

// Get specific email activity
var activity = await sendGridService.GetEmailActivityAsync("email-id");

API Reference

SendGridService Class

Main service class for SendGrid integration.

Methods
  • SendEmailAsync() - Send simple email
  • SendTemplateEmailAsync() - Send email using template
  • SendBulkEmailAsync() - Send bulk emails
  • GetEmailStatsAsync() - Retrieve email statistics
  • GetEmailActivityAsync() - Get email activity data
  • CreateTemplateAsync() - Create email template
  • UpdateTemplateAsync() - Update existing template

Models

  • EmailMessage - Email message structure
  • EmailTemplate - Template data model
  • EmailStats - Email statistics data
  • EmailActivity - Email activity tracking
  • SendGridResponse - API response wrapper

Error Handling

Comprehensive error handling with detailed error messages from SendGrid API. All methods include proper exception handling and return standardized response objects.

Rate Limiting

The library respects SendGrid API rate limits and includes built-in retry logic for handling temporary rate limit exceeded responses.

Email Templates

  • Support for dynamic templates with handlebars syntax
  • Template versioning and management
  • A/B testing capabilities
  • Template validation and testing

Analytics and Tracking

  • Real-time email delivery tracking
  • Open and click tracking
  • Unsubscribe and bounce handling
  • Custom event tracking

Security Features

  • Email authentication (SPF, DKIM, DMARC)
  • Link validation and sanitization
  • Attachment security scanning
  • Content filtering and validation

Testing

Use SendGrid's test environment for development:

  • Test API key from SendGrid dashboard
  • Test email addresses for development
  • Sandbox mode for testing without sending actual emails

License

This library is proprietary to Net3000. Usage is restricted to Net3000.ca solutions and authorized affiliates. Redistribution, sublicensing, or integration with third-party products outside the Net3000 ecosystem is prohibited without written consent from Net3000.

Support

For support and questions, contact the Net3000 development team or visit net3000.ca.

Changelog

v1.0.0

  • Initial release with SendGrid email delivery capabilities
  • Template management and dynamic content support
  • Email analytics and activity tracking
  • Comprehensive error handling and response management
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on net3000.sendgrid:

Package Downloads
net3000.mailingList

Mailing list management library for Net3000.ca applications. Subscriber management, campaigns, multi-platform integrations (SendGrid, MailChimp, Constant Contact), delivery tracking, and audience contact sources.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 76 6/30/2026

Initial release of Net3000 SendGrid library with email delivery and analytics capabilities.