Skip to content

E mail system

tiblu edited this page Sep 11, 2018 · 7 revisions

We use https://github.com/bevacqua/campaign to send e-mails.

E-mail service provider configuration

You can use following providers

  • noop - does nothing, emails are sent to emptyness
  • terminal - emails are sent to standard output
  • nodemailer - emails over SMTP
  • mailgun - Mailgun (https://www.mailgun.com/). You need to signup with Mailgun but they have awesome free plan, so for most cases it should be more than enough.

Sample configuration

Noop

  "email": {
    "provider": {
      "name": "noop"
    }
  },

Terminal

  "email": {
    "provider": {
      "name": "terminal"
    }
  },

Nodemailer

Using Gmail

  "email": {
    "provider": {
      "name": "nodemailer",
      "options": {
        "service": "Gmail",
        "auth": {
          "user": "[email protected]",
          "pass": "GEMAILPASSWORD"
        }
      }
    },
    "trap": "[email protected]",
    "from": "CitizenOs Dev <[email protected]>"
  }

Plain SMTP

  "email": {
    "provider": {
      "name": "nodemailer",
      "options": {
        "host": "smtp.gmail.com",
        "secureConnection": true, 
        "port": 465,
        "auth": {
            "user": "[email protected]",
            "pass": "userpass"
        }
      }
    },
    "trap": "[email protected]",
    "from": "CitizenOs Dev <[email protected]>"
  }

NOTES:

Mailgun

You need to signup with Mailgun - https://www.mailgun.com/. They have awesome free plan, so for most cases it should be more than enough.

  {
    "provider": {
      "name": "mailgun",
      "options": {
        "apiKey": "key-YOURAPIKEY",
        "authority": "YOURDOMAIN.com"
      }
    },
    "from": "CitizenOS <[email protected]>",
    "trap": false
  }

NOTES:

  • trap - where all e-mails are actually sent despite what the "to" line says. Useful for testing and development environments. If false, the e-mail is sent to the "to".

E-mail layout configuration

All e-mail related files are in citizenos-api/views/emails folder.

We offer limited configuration via citizenos-api/config/emails, more info here https://github.com/citizenos/citizenos-api/blob/master/config/emails/README.md

Clone this wiki locally