/email-sender-adapter

Simple SMTP-based email sending adapter for the Mozilla WebThings Gateway

Primary LanguageJavaScriptMozilla Public License 2.0MPL-2.0

email-sender-adapter

A simple adapter exposing actions to send emails through the Mozilla WebThings Gateway.

Setup

First we need to get an app password from Google's account services to use with the email sender adapter. If you want to use a non-Google email account, skip ahead to the Installation and Configuration section and hope that your email server supports SMTP (or submit a pull request!).

To get an app password from Google, first click your profile icon on any google property to bring up the helpful Google Account link. Next, go to the Security section by clicking on it.

The profile icon dropdown with the Google Account and Security links highlighted

In the security section navigate to the App passwords list.

Google's security section

Now we can generate a new app password for the email sender adapter. Name it something you'll remember and click generate to get the app password that you should copy down for later.

Generate App password view

Installation and Configuration

Next, we install the email adapter from the addon list. On your gateway, go to the Settings section and click on Addons. Next, click the plus (+) button and scroll down to install the email adapter. With the adapter installed, we can click "Configure" to configure the adapter with our email address and app password from the Google account page. Gateway's addon list, highlighting the plus button Gateway's addon list, highlighting the email sender adapter's configure button Configuration screen for the email sender adapter

Finally, navigate to the main Things page and click the plus button to add the email sender thing. Image of the Email Thing's detail page

We can even drop the Email Sender notification block into rules to send basic notification emails to ourselves.

Image of a basic email-sending rule where a leak sensor is connected to email notification Configuration of the email-sending rule