Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
parse-mail-adapter-smtp-ejs
Advanced tools
Readme
Parse Server Mail Adapter with EJS templates (SMTP)
Install npm module in your parse server project
$ npm install --save parse-mail-adapter-smtp-ejs
$ yarn add parse-mail-adapter-smtp-ejs
"use strict";
const Express = require('express');
const ParseServer = require('parse-server').ParseServer;
const app = Express();
const APP_PORT = 8080;
let api = new ParseServer({
appName: "Parse Test",
appId: "appid",
masterKey: "secret",
serverURL: "http://localhost:8080/parse",
publicServerURL: "http://localhost:8080/parse",
databaseURI: "mongodb://user:pass@host:27017/parse",
port: APP_PORT,
//This is the config for email adapter
emailAdapter: {
module: "parse-mail-adapter-smtp-ejs",
options: {
nodeMailerOptions: {
host: 'your.smtp.host',
port: 465,
secure: true, //True or false if you are using ssl
auth: {
user: 'email@email.com',
pass: 'AwesomePassword',
}
// you can add here other custom props for nodemailer like "tls"...
},
defaultFrom: 'noreply@sender.address', // Use for ResetPassword, VerifyEmail
templatesOptions: {
locales: ["en", "fr"],
defaultLocale: "en",
templatesDir: __dirname + '/templates/',
templates: {
//This template is used only for reset password email
//The locale used for these templates is the one of user.get("locale") or the default locale
resetPassword: {
//Name to your template
template:'reset-password.html',
//Subject for this email
subject: 'Reset your password'
},
verifyEmail: {
template: 'verify-email.html',
subject: 'Verify Email'
}
}
}
}
}
});
app.use('/parse', api);
app.listen(APP_PORT, function () {
console.log(`Parse Server Ready and listening on port ${APP_PORT}`);
});
templates/
└── en/ // en locale folder
│ └── example.html // en localized file
└── fr/ // fr locale folder
│ └── example.html // fr localized file
=> Parse Server >= 5.0.0
Parse.Cloud.sendEmail({
template: "myTemplate.html", // Email Html
locale: "en",
from: "your@sender.address",
to: "user@email.address",
subject: "my Subejct",
text: "", // Email Text
data: {} // data gives to ejs
});
=> Parse Server < 5.0.0
// Import on top
const { AppCache } = require('parse-server/lib/cache');
// To use in code
const MailAdapter = AppCache.get('appid').userController.adapter;
await MailAdapter.sendMail({
template: "myTemplate.html", // Email Html
locale: "en",
from: "your@sender.address",
to: "user@email.address",
subject: "my Subejct",
text: "", // Email Text
data: {} // data gives to ejs
});
FAQs
Parse Server Mail Adapter with ejs tempates (SMTP)
The npm package parse-mail-adapter-smtp-ejs receives a total of 5 weekly downloads. As such, parse-mail-adapter-smtp-ejs popularity was classified as not popular.
We found that parse-mail-adapter-smtp-ejs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.