Skip to content

Instantly share code, notes, and snippets.

@johnkoht
Last active December 14, 2015 15:48
Show Gist options
  • Save johnkoht/5110020 to your computer and use it in GitHub Desktop.
Save johnkoht/5110020 to your computer and use it in GitHub Desktop.
Capistrano deployment notifications via SMS
# Create a rake task that sends the message using Twilio. You'll
# need a Twilio SID and Token as well as number
namespace :sms do
desc "Send SMS message"
task :send, [:message] => [:environment] do |t, args|
client = Twilio::REST::Client.new TWILIO_SID, TWILIO_TOKEN
client.account.sms.messages.create(
from: TWILIO_NUMBER,
to: PHONE_NUMBER,
body: args[:message]
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment