Giter Site home page Giter Site logo

executor-mail's Introduction

Smart Processes Management

NPM version Downloads Dependency Status code style: prettier

Mail executor for Runnerty:

Email notification module with ejs template support.

Installation:

npm i @runnerty/executor-mail

You can also add modules to your project with runnerty

npx runnerty add @runnerty/executor-mysql

This command installs the module in your project, adds example configuration in your config.json and creates an example plan of use.

If you have installed runnerty globally you can include the module with this command:

runnerty add @runnerty/executor-mysql

Configuration samples:

Add in config.json:

{
  "id": "mail_default",
  "type": "@runnerty-executor-mail",
  "disable": false,
  "from": "Runnerty Notificator <[email protected]>",
  "transport": "smtp://my%mailsender.com:[email protected]/?pool=true",
  "bcc": ["[email protected]"],
  "templateDir": "/etc/runnerty/templates",
  "template": "alerts",
  "ejsRender": true
}
{
  "id": "mail_aws_ses_iam_smtp",
  "type": "@runnerty-executor-mail",
  "disable": false,
  "from": "Runnerty <[email protected]>",
  "transport": {
    "host": "email-smtp.eu-west-1.amazonaws.com",
    "port": 465,
    "secure": true,
    "auth": {
      "user": "aws_ses_user",
      "pass": "aws_ses_pass"
    }
  },
  "templateDir": "/etc/runnerty/templates",
  "template": "alerts",
  "ejsRender": true
}

To use AWS SES transport:

{
  "id": "mail_aws_ses_role",
  "type": "@runnerty-executor-mail",
  "from": "Runnerty <[email protected]>",
  "transport": {
    "service": "SES",
    "region": "us-east-1",
    "ses": {
      // optional extra arguments for SendRawEmail
      "Tags": [
        {
          "Name": "tag_name",
          "Value": "tag_value"
        }
      ]
    }
  },
  "templateDir": "/etc/runnerty/templates",
  "template": "alerts",
  "ejsRender": true
}

Plan sample:

Add in plan.json:

{
  "id": "mail_default",
  "to": ["[email protected]"],
  "title": "Runnerty Mailer",
  "message": "My message from Runnerty!",
  "attachments": [
    {
      "filename": "sample.png",
      "path": "/etc/runnerty/templates/alerts/images/sample.png",
      "cid": "[email protected]"
    }
  ]
}

EJS Template sample:

Plan:

{
  "id": "mail_default",
  "to": ["[email protected]"],
  "title": "Runnerty Mailer",
  "message": "My message from Runnerty!",
  "args": { "value_one": "Hello", "value_two": "world!", "value_three": ":YYYY" }
}

HTML Template:

<html>
  <head>
    <title><%= value_one %> <%= value_two %></title>
  </head>
  <body>
    <%= value_three %>
  </body>
</html>

Want to help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing.

executor-mail's People

Contributors

carloscarmona avatar alo avatar antonlk avatar pakitovic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.