Skip to content

Latest commit

 

History

History
46 lines (39 loc) · 2.97 KB

README.md

File metadata and controls

46 lines (39 loc) · 2.97 KB

Alfred Slack Bot

Codacy Badge Add to Slack

Your personal slack butler

Alfred helps you to automatically send birthday and anniversary wishes on Slack using Google Apps Script, Google Triggers, Google Sheets, and Slack API.

Getting Started

➡️ In-depth Tutorial: https://alfred.danishshakeel.me/read

  1. Authorize the app to your Slack workspace
  2. Copy the Incoming Webhook URL
  3. Create a Google Script for your Google Sheet using Tools > Script Editor
  4. Add a Library - Import Alfred using the ID - 1u4gU_yqTtdvhckO5JymTXz87MDKerxg8jc2bPeO4x6ATRS8O7cEs7eoj
  5. Create a file and use the alfredExample() as a reference
function alfredExample() {
  // Instantiate a new config object with the Slack Webhook URL.
  const config = Alfred.createConfig('https://hooks.slack.com/services/T000000000000/B0AAAAAAAAA/ABCDEXYZ123456')

  // Set parameters.
  config.dataSheet = 'Data' // Set name of the sheet containing data.
  config.messageSheet = 'Messages' // Set name of the sheet containing messages.
  config.dobColumnKey = 'DOB' // Birthdate column key.
  config.annivColumnKey = 'Joining' // Joining Date/Anniversary column key.
  config.namesColumnKey = 'rtCamper' // Names column key.
  const date = new Date() // Init a date object.
  date.setDate(date.getDate() - 1) // Example: match events for yesterday.
  config.dateToMatch = date // Set date.

  // Configure messages.
  config.birthdayHeader = 'Birthday Bash!'
  config.birthdayImage = 'https://i.pinimg.com/736x/ee/f0/36/eef036f583e91a438896a377716ea85e.jpg'
  config.birthdayTitle = 'Today, these folks are celebrating their birthdays :birthday::'
  config.anniversaryHeader = 'Cheers to another year at rtCamp!'
  config.anniversaryImage = 'https://i.pinimg.com/736x/53/62/20/536220dd51e9c770b986ba364c13cf27.jpg'
  config.anniversaryTitle = 'These folks are celebrating their work anniversary today :partying_face::'

  // Run Alfred.
  Alfred.runAlfred(config);
}

To setup automatic messaging, use Google Triggers (Time-driven Google Timers)

➡️ Script ID: 1u4gU_yqTtdvhckO5JymTXz87MDKerxg8jc2bPeO4x6ATRS8O7cEs7eoj