All Projects → macarthuror → parse-smtp-template

macarthuror / parse-smtp-template

Licence: MIT license
Parse Server Module to easy send emails via SMTP with a customizable template option

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to parse-smtp-template

parse-hipaa
HIPAA & GDPR compliant ready parse-server with postgres/mongo, parse-hipaa-dashboard. Compatible with ParseCareKit
Stars: ✭ 74 (+311.11%)
Mutual labels:  parse-server
laravel-simplegrid
A simple component for generating powerful grids with Laravel.
Stars: ✭ 35 (+94.44%)
Mutual labels:  multi-language
squirrelmail
🌰️🐿️ SquirrelMail GitHub Repository (PHP 7-OK!)
Stars: ✭ 42 (+133.33%)
Mutual labels:  smtp
MailDemon
Smtp server for mass emailing, managing email lists and more. Built on .NET Core. Linux, MAC and Windows compatible.
Stars: ✭ 113 (+527.78%)
Mutual labels:  smtp
aws-lambda-node-mailer
NodeJs code for Firing Email via AWS-Lambda and SES
Stars: ✭ 24 (+33.33%)
Mutual labels:  smtp
p2p-project
A peer-to-peer networking framework to work across languages
Stars: ✭ 68 (+277.78%)
Mutual labels:  multi-language
go-smtp-mock
SMTP mock server written on Golang. Mimic any 📤 SMTP server behavior for your test environment with fake SMTP server.
Stars: ✭ 76 (+322.22%)
Mutual labels:  smtp
f3-mailer
Fat-Free Sugar Mailer Plugin
Stars: ✭ 18 (+0%)
Mutual labels:  smtp
fregata
A self hosted REST API for message delivery
Stars: ✭ 19 (+5.56%)
Mutual labels:  smtp
mailck
golang library for smtp based email validation
Stars: ✭ 53 (+194.44%)
Mutual labels:  smtp
PySMS
Simple Python API that that allows you to send texts via SMTP with a best effort approach and process replies via IMAP
Stars: ✭ 19 (+5.56%)
Mutual labels:  smtp
imap-honey
IMAP or SMTP honeypot written in Golang
Stars: ✭ 22 (+22.22%)
Mutual labels:  smtp
Mailozaurr
Mailozaurr is a PowerShell module that aims to provide SMTP, POP3, IMAP and probably some other ways to interact with Email. Underneath it uses MimeKit and MailKit libraries written by Jeffrey Stedfast.
Stars: ✭ 107 (+494.44%)
Mutual labels:  smtp
catapulte
Rust implementation of catapulte email sender
Stars: ✭ 113 (+527.78%)
Mutual labels:  smtp
SimpleKotlinMail
A simple, coroutine based Kotlin Email API for both client- and server-side projects
Stars: ✭ 56 (+211.11%)
Mutual labels:  smtp
ControlCenter
Mirrored from GitLab! Monitoring and automation for Open Source email servers, starting with Postfix. Please do not submit issues or PRs here - join us at: https://gitlab.com/lightmeter
Stars: ✭ 88 (+388.89%)
Mutual labels:  smtp
messages
A python package designed to make sending messages easy and efficient!
Stars: ✭ 38 (+111.11%)
Mutual labels:  smtp
revel
[Deprecated] Revel is an elegant forum or knowledge sharing system base on NodeJS especially VueJS and Parse-Server
Stars: ✭ 18 (+0%)
Mutual labels:  parse-server
imail
small mail server
Stars: ✭ 88 (+388.89%)
Mutual labels:  smtp
ExtractMultiString
multi-language resources to excel
Stars: ✭ 13 (-27.78%)
Mutual labels:  multi-language

Logo

Parse SMTP Template

An easy way to send email templates via SMTP with your Parse Server!
(Multi Language Support)
npm version total downloads monthly downloads
contributors license
Report Bug · Request Feature

FOSSA Status

Table of Contents

About The Project

This is a module made it for Parse Server and an easy solution to send emails via SMTP with templates in HTML, also with the posibility of use a multi language support for your templates.

We recomend you to use the Cerberus project for the email templates.

( if you know about other templates you can added )

Built With

Getting Started

This module is a very simple solution and because of that you can get it up and running in a few minutes.

Installation

  1. Install the package

npm

npm i parse-smtp-template

yarn

yarn add parse-smtp-template
  1. In your Parse Server add the configuration of the emailAdapter and fill the requeriments to connect with your email account
var api = new ParseServer({
    ...
    emailAdapter: {
        module: 'parse-smtp-template',
        options: {
            port: 587,
            host: "smtp.mail.com",
            user: "[email protected]",
            password: "SecurePassword",
            fromAddress: '[email protected]'
        }
    }
})

Now is ready to use!

--

  1. (Optional) Config your email template

In this module you can choise to use a simple template (1 template for bouth emails) or multiTemplate (1 template per type of email) If you want to use the multi Language mode you need to set up the multi languaje mode.


Usage

Use it, it´s very easy 😎😃👌

Simple template

This template is used to send bouth email (password recovery and email confirmation)

The templates have access to 6 parameters :

  • link
  • btn
  • body
  • username
  • appName
  • subject
  • options (optional)

To use it you only need to write ${parameter} on the template

IMPORTANT -- All the HTML file need to use only double quotes to avoid problems

If you want a custome template is necessary to select the correct file. In this example we are gonna use template.html

index.js

emailAdapter: {
  module: 'parse-smtp-template',
  options: {
    ...
    template: true,
    templatePath: "views/templates/template.html",

    // Custome options to your emails
    // You can add more options if you need
    passwordOptions: {
        subject: "Password recovery",
        body: "Custome pasword recovery email body",
        btn: "Recover your password"
        /* --EXTRA PARAMETERS--
        others: {
          extraParameter
        }
        */
    },
    confirmOptions: {
        subject: "E-mail confirmation",
        body: "Custome email confirmation body",
        btn: "confirm your email"
    },
  }
}

To use the extra parameters please use ${options.extraParameter}

directory

project
│   index.js   
│
└─ views
│   └─ templates
│       └─ template.html
|
└─ node_modules
|

template.html

...
<tr>
  <td style="padding: 20px; font-family: sans-serif; font-size: 15px; line-height: 20px; color: #555555;">
  <h1 style="margin: 0 0 10px; font-size: 25px; line-height: 30px; color: #333333; font-weight: normal;">  ${subject}  </h1>
  <br>
  <ul style="padding: 0; margin: 0; list-style-type: disc;">
  <li style="margin:0 0 10px 30px;" class="list-item-first">App name: <b>  ${appName}  </b></li>
  <li style="margin:0 0 10px 30px;">Username: <b>  ${username}  </b></li>
  <li style="margin: 0 0 10px 30px;">link:</li>
  <li style="margin: 0 0 0 30px;" class="list-item-last">  ${link}  </li>
  </ul>
  </td>
</tr>
...

You can look up the template by default to get a better understanding

--

Multi template

This option is a better way to customize your emails because you are able to use a different template per type of email.

This template have access to 7 parameters:

  • user (all the info of the User object)
  • link
  • appName
  • subject
  • body
  • btn
  • options (optional)

The options parameter needs to have subject, body and btn like minimun

index.js

emailAdapter: {
  module: 'parse-smtp-template',
  options: {
    ...
    multiTemplate: true,
    confirmTemplatePath: "views/templates/confirmTemplate.html",
    passwordTemplatePath: "views/templates/passwordTemplate.html",

    // Custome options to your emails
    // You can add as much as you need
    passwordOptions: {
        subject: "Password recovery",
        body: "Custome pasword recovery email body",
        btn: "Recover your password"
        /* --EXTRA PARAMETERS--
        others: {
          extraParameter
        }
        */
    },
    confirmOptions: {
        subject: "E-mail confirmation",
        body: "Custome email confirmation body",
        btn: "confirm your email"
    },
  }
}

To use the extra parameters please use ${options.extraParameter}

--

Multi language

To be able to use Multi language is necesary set multiTemplate and multiLang true and pass the column name where the language is stored in the multiLangColumn option. Default of multiLangColumn is lang.

multiLangColumn and the object needs to have the same value.

index.js

emailAdapter: {
  module: 'parse-smtp-template',
  options: {
    ...
    multiTemplate: true,
    confirmTemplatePath: "views/templates/confirmTemplate.html",
    passwordTemplatePath: "views/templates/passwordTemplate.html",
    multiLang: true,
    multiLangColumn: "language", // Default is "lang".
    multiLangPass: {
      es: {
        subject: "Recuperación de Contraseña",
        body: "Cuerpo del correo de recuperación de contrseña",
        btn: "recupera tu contraseña"
        /* --EXTRA PARAMETERS--
        others: {
          extraParameter
        }
        */
      },
      en: {
        subject: "Password recovery",
        body: "Password recovery email body",
        btn: "Recover your password"
      },
      fr: {
        subject: "Récupération du mot de passe",
        body: "Corps de l'e-mail de récupération de mot de passe",
        btn: "récupérer votre mot de passe"
      }
    },

    multiLangConfirm: {
      es: {
        subject: "Confirmación de Correo",
        body: "Cuerpo del correo de confirmación de correo",
        btn: "confirma tu correo"
      },
      en: {
        subject: "E-mail confirmation",
        body: "Mail confirmation email body",
        btn: "confirm your email"
      },
      fr: {
        subject: "Mail de confirmation",
        body: "Courriel de confirmation du corps de l'e-mail",
        btn: "confirmez votre email"
      }
    },

    // Default options if the lang of the user isn´t in some of the multiLanguage objects
    passwordOptions: {
        subject: "Password recovery",
        body: "Custome pasword recovery email body",
        btn: "Recover your password"
        /* --EXTRA PARAMETERS--
        others: {
          extraParameter
        }
        */
    },
    confirmOptions: {
        subject: "E-mail confirmation",
        body: "Custome email confirmation body",
        btn: "confirm your email"
    },
  }
}

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributors

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Arturo Ortega - @MacarthurOr - [email protected]

Project Link: https://github.com/macarthuror/parse-smtp-template

Acknowledgements

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].