Skip to content

mena-devs/slack-invite-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slack Invite Flow

This project allows developers to build custom activities when plugged into the flow machinery, would constitute a sequential workflow for inviting people to slack.

Installation

pip install -r requirements.txt

Configuration

The system requires some configuration and input in order for it to properly run:

  • a configuration file
    • List of slack administrators required
    • Slack Token required
    • Quip Token required
    • Target Quip Document ID required
    • Mail settings required
  • the user that is being invited
  • the referring user
  • the shortname of the admin as it appears in the configuration file

How It Works

The workflow that is preconfigured is as follows and it is currently tuned for MENA Devs Slack Invitations:

InviteUserToSlackTeam -> UpdateQuipMembersDocument -> SendCodeOfConductEmail

Each activity when plugged into the workflow machinery must also provide flags that identify whether the activity can fallthrough on error or shortcircuit if the activity fails to complete. Additionally the activity configuration must provide a repeat flag that defines how many times the activity can repeat before the flow machinery gives up (This can be helpful in case of credential problems or connection problems, etc..)

By default the system comes with three built-in activities:

InviteUserToSlackTeam

Uses the slack api in order to send an invitation to a user. The method used by the system is an undocumented function call users.admin.invite

UpdateQuipMembersDocument

Uses the quip api (locally imported, unavailable on pypi) in order to append to a members document the details pertaining to the invitation. (as seen by the ROW_TEMPLATE)

SendCodeOfConductEmail

Uses smtplib and an imap server (defaults to gmail configuration) in order to send a code of conduct email to the user. The mailer attaches two different messages, one as plain text and the other as html, both configurable by a template and within the configuration file itself.

Sample Flow Run

% python main.py
MENA Devs Slack Invite - Automation
> admin short name: dany
[who] short name: john
[who] first name: John
[who] last name: Doe
[who] email: [email protected]
[referrer] short name: jane
[referrer] first name: Jane
[referrer] last name: Smith
[referrer] email: [email protected]
Flow: Starting
Flow: Playing inviter
Flow: Playing updater
Flow: Playing notifier
Username: [email protected]
Password:
Flow: Complete

TODO

  • the system is missing quite a bit of tests
  • the system focuses on a CLI entry point, this doesn't have to be the case
  • there are some TODO that needs handling (find them!) ...

About

Scaffold for process automation of MENA-Dev's Slack Group

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages