@swarmjs/mail
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Version Downloads License Build

Logo

@swarmjs/mail

HTML email notification generator.

Table Of Contents

About The Project

This package aims to help developers quickly create simple and clean HTML notification emails.

Built With

  • TypeScript@4

Getting Started

Installation

yarn add @swarmjs/mail

or

npm install --save @swarmjs/mail

Usage

import { Mail } from '@swarmjs/mail'
const html = Mail.create('Email preview message')
  .header({
    logo: 'https://www.example.com/image.png'n
    title: 'Login with a magic link'
  })
  .text(
    `Here some text`
  )
  .button(
    'Button text',
    `http://example.com/url`
  )
  .alert({
     title: 'Alert title',
      description: 'Alert description',
      windowTitle: 'ALERT',
      buttonText: 'More details',
      url: 'https://www.example.com',
  })
  .warning({
     title: 'Alert title',
      description: 'Alert description',
      windowTitle: 'ALERT',
      buttonText: 'More details',
      url: 'https://www.example.com',
  })
  .info({
     title: 'Alert title',
      description: 'Alert description',
      windowTitle: 'ALERT',
      buttonText: 'More details',
      url: 'https://www.example.com',
  })
  .success({
     title: 'Alert title',
      description: 'Alert description',
      windowTitle: 'ALERT',
      buttonText: 'More details',
      url: 'https://www.example.com',
  })
  .spacer(20) // add 20px space
  .end()

Roadmap

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

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.

  • If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit the README.md file with necessary changes.
  • Please make sure you check your spelling and grammar.
  • Create individual PR for each suggestion.
  • Please also read through the Code Of Conduct before posting your first idea as well.

Creating A Pull Request

  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.

Mailors

/@swarmjs/mail/

    Package Sidebar

    Install

    npm i @swarmjs/mail

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    124 kB

    Total Files

    19

    Last publish

    Collaborators

    • guillaume-gagnaire