Lighthouse Digest
Use this with launchd to create digest emails for Lighthouse tickets. Example uses:
- Send a summary of stale tickets to members on your team every week.
- Get daily summaries of tickets created that day
- Get daily summaries of tickets closed that day
# Set basic Lighthouse info
# Your lighthouse account name
Lighthouse.account = "activereload"
# Your API Key for this particular project
Lighthouse.token = "YOUR TOKEN"
Lighthouse::Digest.new do |digest|
digest.project_id = 44 # Lighthouse project id
digest.from = "you@someemail.com" # optional
digest.query = "state:open updated:'three weeks ago - two weeks ago'" # Any valid Lighthouse search
digest.emails = "foo@email.com, bar@email.com" # Who to send this digest too
end
Here is a typical launchd script to email you once a week. Place this in ~/Library/LaunchAgents/com.lighthouseapp.project.digest.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.lighthouseapp.activereload.digest</string>
<key>ProgramArguments</key>
<array>
<string>ruby</string>
<string>/Users/Caged/myscript.rb</string>
</array>
<key>RunAtLoad</key>
<false/>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>0</integer>
<key>Minute</key>
<integer>0</integer>
<key>Weekday</key>
<integer>1</integer>
</dict>
</dict>
</plist>
Load it
launchctl load ~/Library/LaunchAgents/com.lighthouseapp.PROJECT.digest
Test it using the label you give it in the plist
launchctl start com.lighthouseapp.PROJECT.digest
Stopping it
If you want to stop this script for good, unload it:
launchctl unload ~/Library/LaunchAgents/com.lighthouseapp.PROJECT.digest