Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@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 CustomProvider;
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
The npm package @techie04/xpresser-mailer receives a total of 3 weekly downloads. As such, @techie04/xpresser-mailer popularity was classified as not popular.
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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.