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.
- 📱 Telegram notifications
- 📧 Email notifications
- 📥 MeliPayamak
npm install @easynotification/core
Send notifications directly to Telegram chats using bot tokens.
Send email notifications with support for HTML templates.
Send SMS With MeliPayamak Console Api
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);
}
- Email ejs support
- WhatsApp integration
- SMS notifications
- Discord integration
- Website
- Api Package
- queues
- And more...
Created with ❤️ for developers