Time to start planning our script for Slack, and the first step is to ask ourselves what do we want out of it. Let's recap our requirements, the script has to do as follows:
- Accept the text message to display: required
- Accept a title for the message: required
- Accept a title_link: optional and only if a title is available
- Accept a fallback message: required
- Accept an author_name: optional
- Accept an author_link: optional and only if an author_link available
- Accept an author_icon: optional and only if an author_link available
- Accept a color: required
- Accept a pretext: optional
- Accept fields: required and required title, value and short
- Accept image_URL: optional
- Accept thumb_URL: optional
- Accept footer: optional
- Accept footer_icon: optional and only if the footer is available
- Accept ts: optional
Now, we have a matrix to start building our bits...