Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
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.
react-ses-helper
Advanced tools
A helper library for the Simple Email Service, integrates with AWS SDK
A helper library for the Simple Email Service, integrates with AWS SDK
npm install --save react-ses-helper
Then install the dependencies.
npm install --save aws-sdk
Then review the AWS configuration
The sender (source) email address should be configured and verified. If SES is in sandbox mode, the receiver email address(es) should also be configured and verified. A test email should be sent from the SES console and ensured that the intended receiver receives it.
This is required if you are planning to send templated emails. An html template should be created. As of July 22, SES console does not support adding email templates. They can only be done through the apis. Best way is to do it via aws command line interface.
AWS region, secret and access key form the credentials. These are required to use this package. It is crucial that these credentials are given the SES email sending permissions, otherwise the emails will not be sent.
You can now review the functionality below.
/*
region: aws region
secret: aws secret
key: aws access key
subject: subject of email
source: source email (needs to be configured in aws ses)
destinationToArr: array of destination emails
destinationCCArr: array of emails to be cced
htmlBody: html body
textBody: text body
replyToArr: array to reply to email addresses
template: name of template that is configured in aws ses
templateData: json string representation of key value pairs that are the template data
*/
sendEmail(region, secret, key, subject, source, destinationToArr, destinationCCArr, htmlBody, textBody, replyToArr) {}
sendTemplatedEmail(region, secret, key, source, destinationToArr, destinationCCArr, templateName, templateData, replyToArr) {}
import React, { useEffect } from 'react'
import * as SesHelper from 'react-ses-helper'
const App = () => {
useEffect(() => {
async function sendEmail() {
SesHelper.sendEmail("aws_region", "aws_secret", "aws_key", "Test Subject", "supe*******@**ail.com", ["hrus*******@**ail.com"], [], "HTML Body", "Text Body", [])
}
sendEmail();
}, [])
useEffect(() => {
async function sendTemplatedEmail() {
SesHelper.sendTemplatedEmail("aws_region", "aws_secret", "aws_key", "su******@***il.com", ["hr*******ndale@**ail.com"], [], "TemplateOtp1", "{\"project\": \"superflows\", \"name\": \"Hrushikesh\", \"otp\": \"1313\"}", [])
}
sendTemplatedEmail();
}, [])
return <div>Hello SES Helper</div>
}
export default App
Some part of this module is based on the work done by Ninad Thatte & team at MeGo Technologies.
MIT © superflows-dev
FAQs
A helper library for the Simple Email Service, integrates with AWS SDK
The npm package react-ses-helper receives a total of 13 weekly downloads. As such, react-ses-helper popularity was classified as not popular.
We found that react-ses-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
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.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.