VmadeNotificationPlugin 1.7.0
dotnet add package VmadeNotificationPlugin --version 1.7.0
NuGet\Install-Package VmadeNotificationPlugin -Version 1.7.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="VmadeNotificationPlugin" Version="1.7.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="VmadeNotificationPlugin" Version="1.7.0" />
<PackageReference Include="VmadeNotificationPlugin" />
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 VmadeNotificationPlugin --version 1.7.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: VmadeNotificationPlugin, 1.7.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 VmadeNotificationPlugin@1.7.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=VmadeNotificationPlugin&version=1.7.0
#tool nuget:?package=VmadeNotificationPlugin&version=1.7.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
VmadeNotificationPlugin
Description
VmadeNotificationPlugin is a .NET Core library developed by VMade Software Solutions Private Limited for sending application notifications to Microsoft Teams channels and WhatsApp.
Features
- Send notifications to Microsoft Teams channels.
- Send messages to WhatsApp.
- Simple and easy integration with .NET Core applications.
- Supports custom message formatting.
- Secure and reliable message delivery.
Installation
To install VmadeNotificationPlugin, run the following command:
dotnet add package VmadeNotificationPlugin --version 1.1.0
Usage
App Setting
"VmadeNotificationHub": {
"Server": "https://masked-url.com",
"Key": "XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX",
"TemasMessageSize": "0",
"DefaultTeamsChannelId": "Teams Channel WebKook Id"
},
HomeController.cs
if is MVC Application
[AllowAnonymous]
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult ErrorPage(string ErrorInfo)
{
ViewBag.Error = ErrorInfo;
return View();
}
ErrorPage.cshtml
@{
ViewData["Title"] = "Error Page";
}
<div>
<h4 class="text-danger">@ViewBag.Error</h4>
</div>
Sending a Notification to Microsoft Teams
Program.cs
builder.Services.AddSingleton<VmadeNotificationPlugin.INotification, VmadeNotificationPlugin.Notification>();
If is MVC Application
app.UseMiddleware<VmadeNotificationPlugin.AspnetCoreExceptionMiddleware.ExceptionMiddleware>("/Home/ErrorPage?ErrorInfo", "Sample Title");
Api Application
app.UseMiddleware<VmadeNotificationPlugin.AspnetCoreExceptionMiddleware.ExceptionMiddleware>("", "Api Global Error");
using VmadeNotificationPlugin;
using VmadeNotificationPlugin.Models;
using VmadeNotificationPlugin.Models.Enum_Severity;
using System.Collections.Generic;
using System.Linq;
var Obj = new VmadeNotificationPlugin.Notification(
"https://masked-url.com",
"XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX"
);
var _Message = new NotificationTemplate
{
Title = "Masked App Name",
Severity = Enum_Severity.Error.ToString(),
MessageData = new Dictionary<string, string>()
};
_Message.MessageData = DataCollectionPoints.GetExptionKeys(
_Message.MessageData,
ex.Message.ToString(),
ex.Source.ToString(),
ex.StackTrace.ToString()
);
_Message.MessageData = DataCollectionPoints.RequestModelData(
_Message.MessageData,
_Message
);
Or If AspNet Core
_Message.MessageData = await DataCollectionPoints.AspNetLogExceptionAsync(HttpContext, _env, ex, DateTime.Now, Data);
var teamsResponse = await Obj.SendTeamsMessage(_Message);
Sending a Message to WhatsApp
var whatsappResponse = await Obj.SendWhatsAppMessage(new SendWhatsAppMessage
{
Content = "HI",
MobileNo = "XXXXXXXXXX"
});
Fetching WhatsApp Templates
var _templateList = await Obj.GetWhatsAppTemplate(new WhatsAppTemplatesList { });
foreach (var key in _templateList.result.First().Keywords.Keys.ToList())
{
_templateList.result.First().Keywords[key] = "XXX";
}
foreach (var key in _templateList.result.First().QuickButton.Keys.ToList())
{
_templateList.result.First().QuickButton[key] = "XXX";
}
Sending a WhatsApp Template Message
var _Template = new SendWhatsAppTemplate
{
templateName = _templateList.result.First().TemplateName,
Keywords = _templateList.result.First().Keywords,
QuickButton = _templateList.result.First().QuickButton,
MobileNo = "XXXXXXXXXX",
};
var templateResponse = await Obj.SendWhatsAppTemplate(_Template);
License
This project is licensed under the MIT License.
Contact
For support or inquiries, contact VMade Software Solutions Private Limited.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.AspNetCore.Mvc.Core (>= 2.3.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.2)
- 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.