Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
sendgrid-template-helper
Advanced tools
The Sendgrid wrapper helps to send an email with a dynamic template stored on disk.
The Sendgrid wrapper helps to send an email with a dynamic template stored on disk. It tries to create a dynamic template on the Sendgrid server via Sendgrid API v3, then caches the template ID locally for later uses.
Install sendgrid-template-helper
via NPM:
npm install --save sendgrid-template-helper
# or
yarn add sendgrid-template-helper
Create your Sendgrid API Key from SendGrid
In your development environment, export your Sendgrid API Key as follow:
export SENDGRID_API_KEY=YOUR_API_KEY
To send an email with dynamic email template (template is on your disk):
const path = require("path");
const Email = require("sendgrid-template-helper");
const settings = {
apiKey: process.env.SENDGRID_API_KEY,
prefix: "your_app_name_",
};
const email = new Email(settings);
email
.send({
to: "user@tdev.app",
from: "admin@tdev.app",
subject: `[Test] Sendgrid template helper`,
templatePath: path.resolve(__dirname, "./dynamic-email-template.html"), // absolute path to your template
dynamicTemplateData: {
// your dynamic template data
username: "user",
},
})
.then(() => {})
.catch(console.log);
For more use cases, please see Sendgrid use cases.
Property Name | Type | Description |
---|---|---|
apiKey | string | SendGrid API Key |
prefix | string | The prefix used as namespace to create template name. |
# Export your SendGrid API Key
export SENDGRID_API_KEY=YOUR_API_KEY
# Run all tests
npm test
FAQs
The Sendgrid wrapper helps to send an email with a dynamic template stored on disk.
The npm package sendgrid-template-helper receives a total of 19 weekly downloads. As such, sendgrid-template-helper popularity was classified as not popular.
We found that sendgrid-template-helper 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.