Socket
Socket
Sign inDemoInstall

megapis-mailgun-email

Package Overview
Dependencies
82
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    megapis-mailgun-email

Megapis worker to send email using mailgun


Version published
Maintainers
1
Created

Readme

Source

Send email using mailgun

Gets values to send from config.id key; group values by theirsource property. For each source, load email_*source*.hbs Handlebars template, merge with each value, and append results to a string.

For example, the low tide worker saves its results to the lowTide key, and the email_lowTide.hbs template outputs a div for each low tide with the level, date, and time:

<div>
    {{level}} low tide - {{date}} @ {{time}}
</div>

Create an array of objects with source and html properties:

[
    {
        "source": "lowTide",
        "html" : "<div>\n    -0.1 low tide - 03/06 @ 9:00am\n</div>"
    },
    ...
]

Set sources to array of source and html objects, and merge with *config.id*.hbs* to produce a message.

{{#each sources}}
    <h4>{{source}}</h4>
    <div>
        {{{html}}}
    </div>
{{/each}}

If there is something to send, send an email via Handlebars using the API key in config.mailgun.apiKey and domain in config.mailgun.domain.

Keywords

FAQs

Last updated on 17 Jul 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc