npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mdc-email-smtp

v1.0.1

Published

Email adapter for MDC.

Downloads

5

Readme

mdc-email-smtp

Message Distributing Center (MDC) 专用邮件适配器。

安装

$ npm install --save mdc-email-smtp

使用

配置

在 MDC 配置文件中做好配置,如:

{
  ...,
  "pubsub": {
    ...,
    "consumerAdapters": [{
      "queueName": "SPECIFY_A_NAME",
      "require": "mdc-email-smtp",

      // 其它 mdc-email-smtp 参数
      ...
    }]
  }
}

其中其它 mdc-email-smtp 参数列表直接使用 nodemailer 创建 Transporter 的参数。如:

...,

"consumerAdapters": [{
  "queueName": "SPECIFY_A_NAME",
  "require": "mdc-email-smtp",

  "host": "smtp.gmail.com",
  "port": 587,
  "secure": false,
  "auth": {
    "user": "[email protected]",
    "pass": "pass"
  }
}]

做好配置之后在 MDC 中直接启动消费者端即可。

默认模板配置

如果需要添加默认模板文件,则直接在配置项中添加 "defaultTemplate" 字段即可,其对应的值就是默认模板文件名,格式为 EJS.

消息格式

在生产者端生产消息的时候,注意使用这样的消息格式:

{
  "from": "发件者,格式如 NAME <MAIL@DOMAIN>",
  "to": "收件者列表,逗号分隔",
  "subject": "邮件标题",
  "var": {
    // 这是一个对象,里面各值用于填充 EJS 模板
  },
  "template": "可选项,模板文件,不传则用配置的 defaultTemplate"
}

Major Contributor

XadillaX 死月 http://xcoder.in/

shadow88sky 徐晨