Elixir CSS HTML JavaScript Shell
germsvel Do not show deactivated users in recipients preview
When creating an announcement, deactivated users still show up in the
list of interested users for the `interest`s associated to the
announcement. This commit scopes the query so that only active users are
shown there.

Other changes:

- We add a test for the AnnouncementCreator module to ensure (and
document) that deactivated users subscribed to an `interest` do not
receive an email when the announcement is published.
Latest commit 607b6a3 Aug 14, 2018



Constable is part of the thoughtbot Elixir family of projects.

Constable is a Phoenix app for posting announcements and having discussions. To learn more about Phoenix, check out Programming Phoenix

Starting the Console

Use bin/console to start the console. Use bin/console staging|production to start the console in staging or production.

Reactivating Users

Users are deactivated if they leave thoughtbot. Sometimes someone with the same first name joins thoughtbot later and inherits the deactivated email so we need to reactivate the email.

  • Run bin/console production
  • Run Constable.User.reactivate("person@thoughtbot.com")

Developing the Application

To set up your development environment, there are a few steps you'll need to follow.

Install Required Dependencies

If you're on OS X and using Homebrew, run brew install elixir phantomjs node. Otherwise, follow the instructions on the Elixir installation page, the PhantomJS page, and the Node downloads page.

Configure Your Local Environment


# Will grab all Elixir and NPM dependencies and then setup the database
$ bin/setup

Starting the Phoenix Server

Once all the dependencies have been installed, you can start the Phoenix server with:

$ mix phoenix.server

Email Templates

You can edit the email contents from web/templates/email.

You can preview templates by going to localhost:4000/emails/#{template_name}. You can find a list of templates in the EmailPreviewController.

Viewing Sent Emails

You can view sent emails in development by going to localhost:4000/sent_emails


Run mix test

Static Analysis

Run mix dialyzer.plt to build the lookup table for static analysis. Then run mix dialyzer to run analysis. If your dependencies or your elixir version change, delete .dialyzer.plt and run mix dialyzer.plt to rebuild it.

There are still a lot of warnings that are not fixable, but occasionally some real errors are found by dialyzer


  1. If you have not run bin/setup yet, run it to add the correct git remotes.
  2. Run bin/deploy (staging|production)

Review Apps

Constable is setup with support for Heroku Review Apps.

Google enforces a white list of OAuth redirect URLs, so for review apps we redirect the OAuth flow through the Constable oauth redirector which then redirects back to the correct review app. This is configured with the OAUTH_REDIRECT_OVERRIDE environment variable.


Constable is Copyright (c) 2015-2016 Blake Williams, Paul Smith, and thoughtbot, inc. It is free software, and may be redistributed under the AGPL license detailed in the LICENSE file.

About thoughtbot


Constable is maintained and funded by thoughtbot, inc. The names and logos for thoughtbot are trademarks of thoughtbot, inc.

We love open source software, Elixir, and Phoenix. Work with thoughtbot's Elixir development team to design, develop, and grow your product.