link-share/lib/sms_notifier.rb

13 lines
236 B
Ruby
Raw Normal View History

2016-10-05 20:56:09 -04:00
class SmsNotifier
cattr_reader :sns, instance_accessor: false do
Aws::SNS::Client.new
end
def self.notify(link)
sns.publish({
topic_arn: ENV['AWS_TOPIC'],
message: "#{link.title}: #{link.url}",
})
end
end