Class: IPASend::SESNotifier
- Inherits:
-
Object
- Object
- IPASend::SESNotifier
- Defined in:
- lib/ipasend/ses_notifier.rb
Instance Attribute Summary collapse
-
#display_name ⇒ Object
Returns the value of attribute display_name.
Instance Method Summary collapse
-
#initialize(options) ⇒ SESNotifier
constructor
A new instance of SESNotifier.
- #notify(ipa, url) ⇒ Object
Constructor Details
#initialize(options) ⇒ SESNotifier
Returns a new instance of SESNotifier.
8 9 10 11 12 13 14 15 |
# File 'lib/ipasend/ses_notifier.rb', line 8 def initialize() @ses = AWS::SimpleEmailService.new( :access_key_id => .aws_key, :secret_access_key => .aws_secret ) @from = .from @emails = .notify end |
Instance Attribute Details
#display_name ⇒ Object
Returns the value of attribute display_name.
6 7 8 |
# File 'lib/ipasend/ses_notifier.rb', line 6 def display_name @display_name end |
Instance Method Details
#notify(ipa, url) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ipasend/ses_notifier.rb', line 17 def notify(ipa, url) subject = "New build of #{display_name || ipa.name} #{ipa.bundle_short_version} (#{ipa.bundle_version})" template = ERB.new(open(File.join(IPASend.template_dir, 'email.txt.erb')).read) = template.result(binding) for email in @emails do begin @ses.send_email(:subject => subject, :from => @from, :to => email, :body_text => ) puts "### Notified #{email}" rescue => e puts "!!! Cannot send email to #{email}: #{e.}" end end end |