Skip to content

Flask server that sends emails based of a configurable message template to the desired groups of users

Notifications You must be signed in to change notification settings

rushilshah1/chronicle-communicator

Repository files navigation

Chronicle Communication Platform POC

Running Locally

  1. If you would like to test the communication feature to send an email, fill in sender_email and sender_password environment variables in docker-compose.yml.
  2. The email needs to be a valid gmail. Ensure this account setting is set to ALLOW
  3. docker-compose up
    This will instantiate a local postgres db with sample data and run a flask server on port 5000 .

API Endpoints

Base API prefix: /chronicle

  1. Users
    • GET /users, /users/{userId}
    • POST /users. Sample payload:
      {
          "firstName": "Greatest",
          "lastName": "Ever",
          "email": "[email protected]",
          "phone": "4128004543",
          "companyId": 1,
          "accountId": 1234563349,
          "groupId": 1
      }
      
  2. Groups
    • GET /groups, /groups/{groupId}
    • POST /groups. Sample payload:
      {
          "description": "The main target demographic of Company 1",
          "companyId": 1
      }
      
  3. Messages
    • GET /messages, /messages/{messageId}
    • POST /messages. Sample payload:
      {
          "message": "The main target demographic of Company 1",
          "companyId": 1,
          "groupId": 1,
          "channelType": "EMAIL"
      }
      
    • PUT /messages. Sample payload:
      {
          "messageId": 1,
          "message": "Hi :first_name,\n\nThis is a test email to remind you your minimum payment is due for :account_id by tomorrow.\n\n- Chronicle",
          "companyId": 1,
          "groupId": 1,
          "channelType": "EMAIL",
          "active": true
      }
      
  4. Communication - to send specified message to users of the specified group via email
    • POST /communication. Sample payload:
      {
          "messageId": 1,
          "companyId": 1,
          "groupId": 1,
          "channelType": "EMAIL"
      }
      

About

Flask server that sends emails based of a configurable message template to the desired groups of users

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published