1.0.22 • Published 12 months ago

simple-sendmail v1.0.22

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

simpleSend

This tool will help you optimize the process of sending recurring emails such as email confirmation and password recovery.

Who has never needed to create an email confirmation or password recovery system? Well, this tool aims to make the life of us developers easier, bringing beautiful and easily deliverable templates with minimal configuration.

DISCLAIMER

The app is still in alpha, so it may not work as expected. If you find any bugs or has an suggestion, please report them in the issues section.

template 01 - recovery password

image

template 01 - Confirm Email

image

use Examples

HERE

Simple Sendmail

Installation You can install Simple Sendmail using npm:

npm install simple-sendmail

confirm Email Example

import simpleSend, {Message, Config} from "simple-sendmail";
import Template, {ConfirmEmail} from 'simple-sendmail/dist/templates/template';

Usage

Creating an Email Template Here you can choose the language for the email text. If not specified, it will be sent in English. Options: 'en' and 'pt'.

const template:Template = new Template();

Configuring Email Options Each template (HTML) has its own options. For the 'confirmEmail' template, there are only two options, with the title being optional.

const confirmEmailOptions: ConfirmEmail = {
    title: 'Please confirm your e-mail', // optional
    confirmationCode: 999999 // mandatory
};

Configuring Email Settings This tool uses nodemailer for sending emails, so you need to configure it accordingly.

// Node mailer configuration
const config: Config = {
    host: "your_host.com",
    port: 999,
    auth: {
        user: 'your_email@example.com',
        pass: 'your_password'
    }
};

Creating the Email Message

const message: Message = {
    from: 'your_email@example.com', // mandatory
    to: 'to@example.com', // mandatory
    subject: "<only a test>", // optional
    html: template.confirmEmail(confirmEmailOptions) // choose the template and its options here
};

Sending the Email

const sender = new simpleSend(config);
sender.send(message);

Result

image

1.0.22

12 months ago

1.0.21

12 months ago

1.0.2

12 months ago

1.0.0

12 months ago