WebpowerX.Client
1.0.0
dotnet add package WebpowerX.Client --version 1.0.0
NuGet\Install-Package WebpowerX.Client -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="WebpowerX.Client" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WebpowerX.Client" Version="1.0.0" />
<PackageReference Include="WebpowerX.Client" />
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 WebpowerX.Client --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WebpowerX.Client, 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 WebpowerX.Client@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=WebpowerX.Client&version=1.0.0
#tool nuget:?package=WebpowerX.Client&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
WebpowerX.Client
一个面向开发者使用的 WebpowerX iEmail 客户端 SDK。
特性
netstandard2.1- 统一签名生成
- 统一响应封装
- 统一异常类型
- 支持扩展字段
快速开始
using Microsoft.Extensions.DependencyInjection;
using WebpowerX.Client.Models;
var services = new ServiceCollection();
services.AddWebpowerXApiClient(options =>
{
options.BaseUrl = WebpowerXApiEnvironments.AsiaProduction;
options.AccessKey = "your-access-key";
options.AccessKeySecret = "your-access-key-secret";
});
var provider = services.BuildServiceProvider();
var client = provider.GetRequiredService<IWebpowerXApiClient>();
var response = await client.SendTransEmailAsync(new SingleEmailRequest
{
SenderAddressSn = "senderAddressSn",
Subject = "账户安全验证码",
Content = new EmailContent { Type = "html", Value = "<p>Hello</p>" },
Recipient = new Recipient { Email = "user@example.com", Name = "张三" },
SubstitutionObj = new Substitution
{
Data = new Dictionary<string, object?> { ["code"] = "839201" }
}
});
// 批量发送普通邮件:收件人数组与单封发送不同,最多 1000 人,不支持 Enjoy 业务数据。
var bulkResponse = await client.SendBulkEmailsAsync(new BulkEmailRequest
{
SenderAddressSn = "senderAddressSn",
Subject = "订单 {$orderNo} 已发货",
Content = new EmailContent { Type = "html", Value = "<p>您好,{$name},订单 {$orderNo} 已发货。</p>" },
Recipients = new List<Recipient>
{
new Recipient { Email = "alice@example.com", Name = "Alice" },
new Recipient { Email = "bob@example.com", Name = "Bob" }
}
});
var domain = await client.GetDomainAsync(new DomainQuery
{
Domain = "example.com"
});
已实现接口
- 发送单封事务邮件
- 发送单封普通邮件
- 批量发送普通邮件
- 创建个性化发送任务
- 创建固定模板发送任务
- 个性化任务发送
- 固定模板任务发送
- 固定模板任务批量发送
- 云文件任务创建
- 云文件素材任务创建
- 发件地址配置
- 回复地址配置
- 联系人管理
- 联系人属性管理
- 标签管理
- 内容素材管理
- 发送数据统计
打包与发布
# 只生成本地 NuGet 包
powershell -ExecutionPolicy Bypass -File .\nupkg\pack.ps1 -Version 1.0.0
# 发布到 NuGet.org,API Key 可通过参数传入
powershell -ExecutionPolicy Bypass -File .\nupkg\publish.ps1 -Version 1.0.0 -ApiKey "your-nuget-api-key" -SkipDuplicate
# 或者先设置环境变量,避免 API Key 出现在命令历史里
$env:NUGET_API_KEY = "your-nuget-api-key"
powershell -ExecutionPolicy Bypass -File .\nupkg\publish.ps1 -Version 1.0.0 -SkipDuplicate
| 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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | 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.1
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Http (>= 10.0.11)
- Microsoft.Extensions.Options (>= 10.0.11)
- System.Text.Json (>= 10.0.11)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
WebpowerX iEmail Open API client