Class: SendgridNotification::BaseMailer
- Inherits:
-
Object
- Object
- SendgridNotification::BaseMailer
- Defined in:
- app/models/sendgrid_notification/base_mailer.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#from_name ⇒ Object
readonly
Returns the value of attribute from_name.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ BaseMailer
constructor
A new instance of BaseMailer.
- #last_result ⇒ Object
- #last_result_success? ⇒ Boolean
- #sendmail(to, notification_mail, params = {}) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ BaseMailer
Returns a new instance of BaseMailer.
5 6 7 8 9 |
# File 'app/models/sendgrid_notification/base_mailer.rb', line 5 def initialize(params = {}) _params = params.with_indifferent_access @from = _params.fetch(:mail_from) { Rails.application.config.sendgrid_notification.mail_from } @from_name = _params.fetch(:mail_from_name) { Rails.application.config.sendgrid_notification.mail_from_name } end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
3 4 5 |
# File 'app/models/sendgrid_notification/base_mailer.rb', line 3 def from @from end |
#from_name ⇒ Object (readonly)
Returns the value of attribute from_name.
3 4 5 |
# File 'app/models/sendgrid_notification/base_mailer.rb', line 3 def from_name @from_name end |
Instance Method Details
#last_result ⇒ Object
15 16 17 |
# File 'app/models/sendgrid_notification/base_mailer.rb', line 15 def last_result raise NotImplementedError, "you should implement #{self.class}##{__method__}" end |
#last_result_success? ⇒ Boolean
19 20 21 |
# File 'app/models/sendgrid_notification/base_mailer.rb', line 19 def last_result_success? raise NotImplementedError, "you should implement #{self.class}##{__method__}" end |
#sendmail(to, notification_mail, params = {}) ⇒ Object
11 12 13 |
# File 'app/models/sendgrid_notification/base_mailer.rb', line 11 def sendmail(to, notification_mail, params = {}) raise NotImplementedError, "you should implement #{self.class}##{__method__}" end |