Class: Howitzer::MailAdapters::Onesecmail
- Defined in:
- lib/howitzer/mail_adapters/onesecmail.rb
Overview
This class represents 1secMail mail adapter
Instance Attribute Summary
Attributes inherited from Abstract
Class Method Summary collapse
-
.find(recipient, subject, wait:) ⇒ Object
Finds an email in storage.
Instance Method Summary collapse
-
#html_body ⇒ String
Html body of the email message.
-
#mail_from ⇒ String
An email address specified in ‘From` field.
-
#plain_text_body ⇒ String
Plain text body of the email message.
-
#received_time ⇒ String
When email was received.
-
#sender_email ⇒ String
A real sender email address.
-
#text ⇒ String
Stripped text.
Methods inherited from Abstract
#initialize, #mime_part, #recipients
Constructor Details
This class inherits a constructor from Howitzer::MailAdapters::Abstract
Class Method Details
.find(recipient, subject, wait:) ⇒ Object
Finds an email in storage
15 16 17 18 19 20 21 22 |
# File 'lib/howitzer/mail_adapters/onesecmail.rb', line 15 def self.find(recipient, subject, wait:) = {} retryable(find_retry_params(wait)) { = (recipient, subject) } return new() if .present? raise Howitzer::EmailNotFoundError, "Message with subject '#{subject}' for recipient '#{recipient}' was not found." end |
Instance Method Details
#html_body ⇒ String
Returns html body of the email message.
32 33 34 |
# File 'lib/howitzer/mail_adapters/onesecmail.rb', line 32 def html_body ['htmlBody'] end |
#mail_from ⇒ String
Returns an email address specified in ‘From` field.
44 45 46 |
# File 'lib/howitzer/mail_adapters/onesecmail.rb', line 44 def mail_from ['from'] end |
#plain_text_body ⇒ String
Returns plain text body of the email message.
26 27 28 |
# File 'lib/howitzer/mail_adapters/onesecmail.rb', line 26 def plain_text_body ['body'] end |
#received_time ⇒ String
Returns when email was received.
50 51 52 |
# File 'lib/howitzer/mail_adapters/onesecmail.rb', line 50 def received_time Time.parse(['date']).to_s end |
#sender_email ⇒ String
Returns a real sender email address.
56 57 58 |
# File 'lib/howitzer/mail_adapters/onesecmail.rb', line 56 def sender_email ['from'] end |
#text ⇒ String
Returns stripped text.
38 39 40 |
# File 'lib/howitzer/mail_adapters/onesecmail.rb', line 38 def text ['textBody'] end |