A simple Django project to send automatic e-mails whenever its index URL is called.
On this example board, there are three columns:
- Interview phase: Ignored by the script, cards needs to be moved manually to the second column
- To send-email: The column used to run the script, defined by env var
DEFAULT_PENDING_LIST_TITLE
- Done: The column which the script sends the cards that were processed (to avoid e-mails to be sent twice), defined by env var
DEFAULT_DONE_LIST_TITLE
The assistant basically:
- Checks what's the value of
DEFAULT_PENDING_LIST_TITLE
env var, in our case it's To send e-mail - Looks for the column in the board
- When it finds the correct column, reads all the cards and checks what have the Approved/Not approved label
- Parses the e-mail from the card description
- Sends the approval/disapproval e-mail (below) and finally...
- ...moves the card to
DEFAULT_DONE_LIST_TITLE
env var column, in our case it's Done
- Clone the project and set up a virtual environment
- Install dependencies with
pip install -r requirements.txt
- Create a
.env
file with the following required variables:
# SendGrid settings
SENDGRID_USERNAME='sendgrid_username'
SENDGRID_PASSWORD='sendgrid_password'
# Trello settings
TRELLO_KEY='key'
TRELLO_TOKEN='token'
DEFAULT_BOARD_ID='board_id'
DEFAULT_PENDING_LIST_TITLE='To send e-mail'
DEFAULT_DONE_LIST_TITLE='Done'
- Run with
python manage.py runserver
It's not really useful right now because of the app isn't configured to be deployed yet. However, you can use ngrok to simulate the request.
- Go to New Applet
- As the trigger (this), select Button widget or anything you want
- As the action (that), select Webhooks
- Run ngrok (remember to point it to the Django server port, which is
8000
by default) and copy its url - Set the ngrok URL provided to you as the Webhook URL
- Click on Create action
- Tests
- Disapproved flow
- Deploy to Heroku