Our great sponsors
-
email-templates
Discontinued Create, preview (in the browser and in the iOS Simulator), and send custom email templates for Node.js. Highly configurable and supports automatic inline CSS, stylesheets, embedded images and fonts, and much more! Made for @forwardemail and @ladjs. [Moved to: https://github.com/forwardemail/email-templates] (by niftylettuce)
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
mailgen
A Node.js package that generates clean, responsive HTML e-mails for sending transactional mail.
-
lad
Node.js framework made by a former @expressjs TC and @koajs team member. Built for @forwardemail, @spamscanner, @breejs, @cabinjs, and @lassjs.
-
email-templates
Create, preview (browser/iOS Simulator), and send custom email templates for Node.js. Made for @forwardemail, @ladjs, @cabinjs, @spamscanner, and @breejs.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
So, the main difference is that in Emailjs you will use MIME type to work with attachments, while in Nodemailer you use strings.
Another quite popular package is email-templates. As you can see from the name, this package is designed for creating various custom templates for Node.js. It features support for automatic inline CSS, stylesheets, embedded images, and fonts. Also, it has an email preview option. The email templates package was made by the creator of the Lad framework. So it’s recommended to use it with Lad.
One more package worth mentioning here is Mailgen. It is aimed at creating HTML templates for transactional emails. There is a note on Github, that with Mailgen you can “Programmatically create beautiful emails using plain old JavaScript.” The package includes several open-source themes as well as supports custom elements like tables, action buttons, etc. It is your choice how to send an email created with Mailgen, but they recommend checking out Nodemailer for this purpose.
yarn:
Before we dive into reviewing how dynamic content works with HTML emails, it’s worth mentioning a new package that was just released in June 2022. Mailtrap’s very own sending package! Mailtrap provides both sending and testing functionality, and we always aim at saving everyone time and simply making life easier. With that in mind, it only made sense for us to make a package that allows developers to add a sending functionality to a Node.js application quickly. Additionally, it offers integration with the official API for Mailtrap and will be integrated with Nodemailer in the near future.
Another quite popular package is email-templates. As you can see from the name, this package is designed for creating various custom templates for Node.js. It features support for automatic inline CSS, stylesheets, embedded images, and fonts. Also, it has an email preview option. The email templates package was made by the creator of the Lad framework. So it’s recommended to use it with Lad.
Let’s experiment with the email-templates package. It has several interesting features:
If you want to find any issues that can lead to bugs or other inconsistencies use yarn lint with ESLint.
First of all, let’s create our templates, for a frequently occurring scenario: new user registration. In this example, we are working with the default option (for more details and samples of using Pug, refer to Github.)