NotifyCommuniNetFramework 2.0.1
dotnet add package NotifyCommuniNetFramework --version 2.0.1
NuGet\Install-Package NotifyCommuniNetFramework -Version 2.0.1
<PackageReference Include="NotifyCommuniNetFramework" Version="2.0.1" />
<PackageVersion Include="NotifyCommuniNetFramework" Version="2.0.1" />
<PackageReference Include="NotifyCommuniNetFramework" />
paket add NotifyCommuniNetFramework --version 2.0.1
#r "nuget: NotifyCommuniNetFramework, 2.0.1"
#:package NotifyCommuniNetFramework@2.0.1
#addin nuget:?package=NotifyCommuniNetFramework&version=2.0.1
#tool nuget:?package=NotifyCommuniNetFramework&version=2.0.1
Required system dependencies: 1. net6.0 2. Microsoft.Extensions.Configuration (>= 8.0.0) 3. Microsoft.Extensions.Configuration.Json (>= 8.0.0) 4. Newtonsoft.Json (>= 13.0.3)
Required steps: should have appsettings.json file with below keys and value(all are mandatory). //Below keys are mandatory. "NStarXNotificationLogFile": "C:\NStarXNotificationLog\NotificationLogs.txt", "NStarXNotificationFolder": "C:\NStarXNotificationLog", "WebhookURL": "https://healthstream.webhook.office.com/webhookb2/c70e7caf-91a67-492a-bc07-b6d4540ae4c6@be1b4fd9-5fce-4f73-b3dd-3005f9e18ec7/IncomingWebhook/317d3034f56d49d59c6a20ae4ca9e70d/c3f31b9d-84d7-40ce-aab9-643d6ae66415", "Summary": "Defalut summary", "SenderEmail": "nstarxinc@xxxx.com", "Password": "gpirkxdtpiejxxzkk", "RecipientEmail": "rb@xxxx.com", "Subject": "Your Subject comes here", "Client": "smtp.gmail.com", "Port": 587 ================================= OR ================================== Bind properies to below model's as required. 1. For Teams chat notification TeamsNotification.TeamsNotificationModel teamsNotificationModel = new(); 2. For Email notification EmailNotification.EmailNotificationModel emailNotificationModel = new();
Consume method: bool teamsNotificationResult = await TeamsNotification.TeamsNotificationAsync(teamsNotificationModel); bool emailNotificationResult = await EmailNotification.EmailNotificationAsync(emailNotificationModel);
Sample Code: public static string commonLogFile; public static string NStarXNotificationFolder; public static TeamsNotification.TeamsNotificationModel teamsNotificationModel = new(); public static EmailNotification.EmailNotificationModel emailNotificationModel = new(); public static async Task Main(string[] args) { IConfigurationRoot config = new ConfigurationBuilder() .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .Build();
NStarXNotificationFolder = config["NStarXNotificationFolder"];
Directory.CreateDirectory(NStarXNotificationFolder);
TeamsNotification.TeamsNotificationModel teamsNotificationModel = new()
{
WebhookURL = config["WebhookURL"],
Summary = config["Summary"],
Message = "Replace with your Message or bind value to this property"
};
var t = await TeamsNotification.TeamsNotificationAsync(teamsNotificationModel);
TeamsNotification.TeamsNotificationModel emailNotificationModel = new()
{
emailNotificationModel.SenderEmail = config["SenderEmail"];
emailNotificationModel.Password = config["Password"];
emailNotificationModel.RecipientEmail = config["RecipientEmail"];
emailNotificationModel.Subject = config["Subject"];
emailNotificationModel.Client = config["Client"];
emailNotificationModel.Port = Convert.ToInt16(config["Port"]);
emailNotificationModel.Message = "Email body comes here!";
}
var t1 = await EmailNotification.EmailNotificationAsync(emailNotificationModel);
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net46 is compatible. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.