@easynotification/core
v1.1.0
Published
easynotification core
Downloads
11
Maintainers
Readme
EasyNotification Core
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/coreSupported Channels
Telegram
Send notifications directly to Telegram chats using bot tokens.
Send email notifications with support for HTML templates.
MeliPayamak 
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
