Class: SendgridNotification::BaseMailer

Inherits:
Object
  • Object
show all
Defined in:
app/models/sendgrid_notification/base_mailer.rb

Direct Known Subclasses

NullMailer, SendgridMailer

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fromObject (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_nameObject (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_resultObject

Raises:

  • (NotImplementedError)


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

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


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