Skip to content

Alfred lets you automatically* send out birthday and work anniversary wishes to your Slack Workspace.

Notifications You must be signed in to change notification settings

danish17/alfred-slack-bot

Repository files navigation

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

About

Alfred lets you automatically* send out birthday and work anniversary wishes to your Slack Workspace.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published