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, attachments = []) ⇒ Object
Send mail about:
to
recipent tonotification_mail
NotificationMail object for mail expressionparams
params for notification_mailattachments
attachment in hash or SendgridNotification::Attachment.
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
20 21 22 |
# File 'app/models/sendgrid_notification/base_mailer.rb', line 20 def last_result raise NotImplementedError, "you should implement #{self.class}##{__method__}" end |
#last_result_success? ⇒ Boolean
24 25 26 |
# File 'app/models/sendgrid_notification/base_mailer.rb', line 24 def last_result_success? raise NotImplementedError, "you should implement #{self.class}##{__method__}" end |
#sendmail(to, notification_mail, params, attachments = []) ⇒ Object
Send mail about: to
recipent to notification_mail
NotificationMail object for mail expression params
params for notification_mail attachments
attachment in hash or SendgridNotification::Attachment
16 17 18 |
# File 'app/models/sendgrid_notification/base_mailer.rb', line 16 def sendmail(to, notification_mail, params, = []) raise NotImplementedError, "you should implement #{self.class}##{__method__}" end |