Contributing Guide : Setting up Email Authentication for Development

Contributing Guide : Setting up Email Authentication for Development
0

#1

This guide explains how to setup email authentication for local development

Update:

We have now integrated MailHog for catching emails in flight during development.

Hence you do not need to follow the workaround below. Its as simple as installing MailHog for your system, and opening up the test page. The Contributing guide is updated for installation, please follow the same for more details.


Guide

Prologue:

Our current config uses AWS SES for sending out emails. Of course, this is configured in production.
But, this will affect local setups for development. Earlier, this was not noticeable because creating accounts was based on a local strategy. (The server still used to crash, but the user accounts got created) .


If you do need to use auth to test out some accounts then, local testing / creating accounts can now be done in the below two ways:

Setting up a temporary config (least hassle) Method:

Change this :

to this:

"mail": {
  "name": "mail",
  "connector": "mail",
  "transports": [{
    "type": "SMTP",
    "host": "smtp.gmail.com",
    "secure": true,
    "port": 465,
    "auth": {
      "user": "someone@gmail.com",
      "pass": "somepassword"
    }
  }]
}

Of course replacing the user and pass keys above with your actual credentials.
It highly recommended that you DO NOT use your personal email credentials, rather create a fresh Gmail account and use that (just don’t use it for anything sensitive). This is because:

With GMail, you may need to enable the “access for less secure apps” option. Reference

This setting is available in your Google accounts. https://support.google.com/accounts/answer/6010255?hl=en

After you have set this in the .env, set the variable EMAIL_SENDER=someone@gmail.com as well.

Once you have created the setup, tested, you have to revert the datasources.json back to its state in staging, before making commits or a pull request.

Setting up a permanent config (needs a paid subscription/configuration) Method:

Signup for AWS, and its SES (Simple Email Service). Create Access Keys and Secret for sending emails, steps to which can be referred from their docs.

In the .env set the following:

SES_ID=XXXXXXXXXXXXXXXXXXXXXXX
SES_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
EMAIL_SENDER=user.name@domain.com

And that’s it, you should be good.

Note: This article will be updated if this changes in future.


If you are facing issues or need additional help, please reach out to us in the chat room


#2