link-share/lib/sms_notifier.rb
2016-10-05 23:07:33 -04:00

12 lines
236 B
Ruby

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