Last active
December 14, 2015 15:48
-
-
Save johnkoht/5110020 to your computer and use it in GitHub Desktop.
Capistrano deployment notifications via SMS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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