npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

awsm-mailer

v1.3.7

Published

AWSM package for sending emails.

Downloads

1

Readme

✉️ awsm-mailer

AWSM package for sending emails.

Features

  • 30 Pre-configured services (Gmail, Hotmail, SendGrid...etc)
  • HTML content as well as plain text alternative
  • 32 HTML template engines (handlebars, jade, haml...etc)
  • Easy HTML styling with Juice
  • Embedded images in HTML
  • Email Attachments
  • Unicode to use any characters In your JAWS project root directory, run:

Quick Usage

In your JAWS project root directory, run:

jaws module install https://github.com/jaws-framework/jaws-core-js
jaws module install https://github.com/eahefnawy/awsm-mailer

Set the following env vars (using CLI or the .env file):

EMAIL_SERVICE=Gmail
[email protected]
EMAIL_SERVICE_PASS=password

deploy your code with JAWS dash, then test the Lambda with the following event:

{
  "from": "[email protected]",
  "to": "[email protected]",
  "subject": "Hello",
  "template": "welcome",
  "context": {
    "first_name": "Sam",
    "last_name": "Smith"
  }
}

This will use the welcome template coupled with the context/data (first_name & last_name). You should receive an email that says:

Welcome Sam Smith

You can edit the template text by editing these two files:

<project-dir>/back/aws_modules/awsm-mailer/send/templates/html.handlebars
<project-dir>/back/aws_modules/awsm-mailer/send/templates/text.handlebars

Supported Services

awsm-mailer supports the following 30 service, pre-configured and ready to use. You just provide the username/password:

  • '1und1'
  • 'AOL'
  • 'DebugMail.io'
  • 'DynectEmail'
  • 'FastMail'
  • 'GandiMail'
  • 'Gmail'
  • 'Godaddy'
  • 'GodaddyAsia'
  • 'GodaddyEurope'
  • 'hot.ee'
  • 'Hotmail'
  • 'iCloud'
  • 'mail.ee'
  • 'Mail.ru'
  • 'Mailgun'
  • 'Mailjet'
  • 'Mandrill'
  • 'Naver'
  • 'Postmark'
  • 'QQ'
  • 'QQex'
  • 'SendCloud'
  • 'SendGrid'
  • 'SES'
  • 'Sparkpost'
  • 'Yahoo'
  • 'Yandex'
  • 'Zoho'

Template Engines

awsm-mailer comes with a welcome template for demonstration. You can add/remove templates from the following directory:

<project-dir>/back/aws_modules/awsm-mailer/send/templates/

awsm-mailer uses handlebars as the default template engine. You can use any other template engine by adding it to the package.json file and update dependencies with npm install.

Here's the full list of supported templates:

after chosing your template engine, make sure the file extentions of the template files match the template you chose:

html.{{ext}}
text.{{ext}}
style.{{ext}}

Mail Options (Event Properties):

Here's the full list of options you can pass in your event:

  • from - The e-mail address of the sender. All e-mail addresses can be plain '[email protected]' or formatted 'Sender Name <[email protected]>', see here for details
  • sender - An e-mail address that will appear on the Sender: field
  • to - Comma separated list or an array of recipients e-mail addresses that will appear on the To: field
  • cc - Comma separated list or an array of recipients e-mail addresses that will appear on the Cc: field
  • bcc - Comma separated list or an array of recipients e-mail addresses that will appear on the Bcc: field
  • replyTo - An e-mail address that will appear on the Reply-To: field
  • inReplyTo - The message-id this message is replying
  • references - Message-id list (an array or space separated string)
  • subject - The subject of the e-mail
  • template - The template to use for this email. Make sure it matches one of the folder names inside the templates folder
  • context - The context/data the template needs. eg. {"first_name": "..."}
  • watchHtml - Apple Watch specific HTML version of the message (experimental)
  • headers - An object or array of additional header fields (e.g. {"X-Key-Name": "key value"} or [{key: "X-Key-Name", value: "val1"}, {key: "X-Key-Name", value: "val2"}])
  • attachments - An array of attachment objects
  • alternatives - An array of alternative text contents (in addition to text and html parts)
  • envelope - optional SMTP envelope, if auto generated envelope is not suitable
  • messageId - optional Message-Id value, random value will be generated if not set
  • date - optional Date value, current UTC string will be used if not set
  • encoding - optional transfer encoding for the textual parts