omni-message
v1.1.0
Published
A module to send a mail, a discord message, etc... in one function
Downloads
21
Readme
Omni Message npm module
Get started
Installation
npm i omni-message
Usage
const OmniMessage = require('omni-message');
const message = new OmniMessage();
Methods
Set the mail variables all at once
message.setMailVariables({
use: BOOLEAN,
to: process.env.MAIL_RECEIVER,
mailService: process.env.MAIL_SERVICE,
mailUser: process.env.MAIL_USER,
mailPass: process.env.MAIL_PASS
});
or one by one
message.setMailUse(BOOLEAN);
message.setMailTo(process.env.MAIL_RECEIVER);
message.setMailService(process.env.MAIL_SERVICE);
message.setMailUser(process.env.MAIL_USER);
message.setMailPass(process.env.MAIL_PASS);
Discord
Set the discord variables all at once
message.setDiscordVariables({
use: BOOLEAN,
webhookURL: process.env.DISCORD_TOKEN,
});
or one by one
message.setDiscordUse(BOOLEAN);
message.setDiscordWebhookURL(process.env.DISCORD_TOKEN);
Slack
Set the slack variables all at once
omniMessage.setSlackVariables({
use: true,
token: process.env.SLACK_TOKEN,
channelId: process.env.SLACK_CHANNEL_ID
});
or one by one
omniMessage.setSlackUse(true);
omniMessage.setSlackToken(process.env.SLACK_TOKEN);
omniMessage.setSlackChannelId(process.env.SLACK_CHANNEL_ID);
Suported API
- Discord
- Slack