Class: Yolo::Notify::Ios::OTAEmail
- Defined in:
- lib/yolo/notify/ios/ota_email.rb
Overview
OTAEmail generates an HTML email for OTA build notifications
Instance Attribute Summary
Attributes inherited from Email
#account, #from, #password, #port, #server, #to
Instance Method Summary collapse
-
#body(opts) ⇒ Object
The OTA Email body content, this content is generated using release_notes.md and an HTML email template in the same directory (email.html).
-
#parsed_body(opts) ⇒ String
Returns HTML ready to be used in the email body, HTML is generated by parsing the email.html template and applying realease_notes.md content.
Methods inherited from Email
Constructor Details
This class inherits a constructor from Yolo::Notify::Email
Instance Method Details
#body(opts) ⇒ Object
The OTA Email body content, this content is generated using release_notes.md and an HTML email template in the same directory (email.html)
18 19 20 21 22 23 24 25 26 |
# File 'lib/yolo/notify/ios/ota_email.rb', line 18 def body(opts) = <<MESSAGE_END MIME-Version: 1.0 Content-type: text/html Subject: #{opts[:subject]} #{parsed_body(opts)} MESSAGE_END end |
#parsed_body(opts) ⇒ String
Returns HTML ready to be used in the email body, HTML is generated by parsing the email.html template and applying realease_notes.md content
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/yolo/notify/ios/ota_email.rb', line 34 def parsed_body(opts) file = File.open(File.dirname(__FILE__) + "/email.html", "r") content = file.read markdown = Yolo::Tools::Ios::ReleaseNotes.html content = content.gsub("YOLO.TITLE",opts[:title]) content = content.gsub("YOLO.CONTENT",markdown) if opts[:ota_password] and opts[:ota_password].length > 0 content = content.gsub("YOLO.PASSWORD","<h3>Password</h3><hr><p>#{opts[:ota_password]}</p>") else content = content.gsub("YOLO.PASSWORD","") end content = content.gsub("YOLO.LINK",opts[:ota_url]) content end |