Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@techie04/xpresser-mailer
Advanced tools
A library to help you send mails.
This plugin makes use of nodemailer and aws-sdk ses.
MENU
npm i @techie04/xpresser-mailer
# OR
yarn add @techie04/xpresser-mailer
{
"npm://@techie04/xpresser-mailer": true
}
({
// SMTP CONFIG
"mailer": {
provider: "SMTP", // SMTP
configs: {
smtp: {
host: "", // SMTP Server Host
port: "", // SMTP Server Port
username: "", // SMTP Server Username
password: "", // SMTP Server Password
fromEmail: "no-reply@example.com" // From email
},
aws: {
region: "", // AWS Server Region
fromEmail: "no-reply@example.com", // From email
// AWS credentials
AWS_ACCESS_KEY_ID: "",
AWS_SECRET_ACCESS_KEY: ""
},
postmark: {
apiToken: ""
}
}
},
})
In your controller or anywhere in your project.
const { sendMail } = require("@techie04/xpresser-mailer");
await sendMail(message);
import { sendMail } from "@techie04/xpresser-mailer";
await sendMail<Message, MessageResponse>(message);
sendMail
function (depending on provider)Create a file, maybe providers/CustomProvider.ts
import { MailProvider } from "@techie04/xpresser-mailer/MailProvider";
// The name should be the same with the config key.
const CustomProvider = new MailProvider("customProvider", {
/**
* Initialize your provider.
* @param config - The config for your provider. i.e mailer.configs.customProvider
* @param $ - xpresser instance
*/
initialize(config, $) {
// Validate config here
// return client.
},
/**
* Send mail function.
* @param mail - the mail object or data
* @param config - The config for your provider. i.e mailer.configs.customProvider
* @param client - The client returned from the initialize function above.
* @param $
*/
sendMail({ mail, config, client }, $) {
// Send mail here.
}
});
export default PostmarkProvider;
const config = {
"mailer": {
// ... other configs
customProviders: {
// key is providers name
// value is path to provider file without .js or .ts
customProvider: "providers/CustomProvider"
}
}
}
FAQs
Mailer Plugin for xpresser
We found that @techie04/xpresser-mailer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.