8000 GitHub - easynotification/core: core nestjs module for easypay notificaiton
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

easynotification/core

Repository files navigation

EasyNotification Core

Website

A powerful and flexible notification system built with NestJS that supports multiple notification channels. This is the core module of the EasyNotification project, providing the foundation for sending notifications through various channels.

Features

  • 📱 Telegram notifications
  • 📧 Email notifications
  • 📥 MeliPayamak

Installation

npm install @easynotification/core

Supported Channels

Telegram

Send notifications directly to Telegram chats using bot tokens.

Email

Send email notifications with support for HTML templates.

MeliPayamak Website

Send SMS With MeliPayamak Console Api

Setup

import { EasyNotificationModule } from "@easynotification/core";

@Module({
  imports: [
    EasyNotificationModule.register({
      isGlobal: true,
      telegramOptions: {
        token: "your bot token here",
      },
      emailOptions: {
        from: "from",
        auth: {
          password: "password",
          username: "username",
        },
        host: "host",
        port: 587, // 587 or 465
        secure: false, // false for 587 and true for 465
      },
      melipayamakOptions: {
        console_url: "",
      },
    }),
  ],
})
export class AppModule {}
import { EasyNotificationService } from "@easynotification/core";

@Injectable()
export class AppService {
  constructor(private readonly easyNotificationService: EasyNotificationService);
}

const response = await this.easyNotificationService.sendNotification("EMAIL", {
  to: "",
  subject: "",
  html: "",
  text: "",
});

if (response.ok) {
  console.log("Email success response", response.result);
} else {
  console.log("Email error response", response.error);
}

const response = await this.easyNotificationService.sendNotification("TELEGRAM", {
  chat_id: 1,
  text: "",
});

if (response.ok) {
  console.log("Telegram success response", response.result);
} else {
  console.log("Telegram error response", response.error);
}

const response = await this.easyNotificationService.sendNotification("MELIPAYAMAK", {
  to: "phonenumber",
  bodyId: 10000,
  args: ["1", "1000"],
});

if (response.ok) {
  console.log("Melipayamak success response", response.result);
} else {
  console.log("Melipayamak error response", response.error);
}

Future Plans

  • Email ejs support
  • WhatsApp integration
  • SMS notifications
  • Discord integration
  • Website
  • Api Package
  • queues
  • And more...

Created with ❤️ for developers

About

core nestjs module for easypay notificaiton

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0