/messaging-consenter

Lightweight Django app for serving a web page to collect user consent to receive WhatsApp messages

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Messaging Consenter

Build Passing/Failing on TravisCI.com Code Style: Black Code Coverage Docker Automated build

Messaging-Consenter is a lightweight Django application for serving a consent form to users. Consent is then saved on the RapidPro contact matching the UUID in the URL. This might get rolled into https://github.com/praekeltfoundation/rp-sidekick at some point.

Usage

Run docker container with the following environment variables set
  • CONSENT_REDIRECT_URL (Optional) - URL to redirect a user to after they have provided consent (default: /consent/success/)
  • RAPIDPRO_URL - URL for the RapidPro instance
  • RAPIDPRO_TOKEN - authentication token for the RapidPro token
  • RAPIDPRO_FLOW_ID (Optional) - the id of the RapidPro flow to start a user on once they have provided consent
The RapidPro Organisation must have two custom fields for Contacts:
  • consent_date (Date and Time field)
  • consent ("true" or "false" Text field)

Build a link for the user using the domain for the application, the word "consent" and their RapidPro UUID. When they provide consent their RapidPro Contact will be updated and they will be redirected to CONSENT_REDIRECT_URL.

Local installation

To set up and run messaging-consenter locally, do the following:

$ git clone git@github.com:praekeltfoundation/messaging-consenter.git
$ cd messaging-consenter
$ virtualenv ve
$ source ve/bin/activate
$ pip install -e .
$ pip install -r requirements-dev.txt

Tools

  • black - this repository uses an opinionated python code formatter. See pyproject.toml for config.

Contributing

See our ways of working for a guide on how to contribute to messaging-consenter.