Class: SendgridNotification::SendgridMailer

Inherits:
BaseMailer
  • Object
show all
Includes:
MailRecordable
Defined in:
app/models/sendgrid_notification/sendgrid_mailer.rb

Defined Under Namespace

Classes: Error

Instance Attribute Summary

Attributes inherited from BaseMailer

#from, #from_name

Instance Method Summary collapse

Methods inherited from BaseMailer

#initialize

Constructor Details

This class inherits a constructor from SendgridNotification::BaseMailer

Instance Method Details

#last_resultObject



11
12
13
14
15
# File 'app/models/sendgrid_notification/sendgrid_mailer.rb', line 11

def last_result
  # SendGrid::Response class
  # https://github.com/sendgrid/ruby-http-client/blob/master/lib/ruby_http_client.rb
  sendgrid_client.last_response
end

#last_result_success?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'app/models/sendgrid_notification/sendgrid_mailer.rb', line 17

def last_result_success?
  sendgrid_client.last_response.try!(:success?)
end

#sendmail(to, notification_mail, params, attachments = []) ⇒ Object



6
7
8
9
# File 'app/models/sendgrid_notification/sendgrid_mailer.rb', line 6

def sendmail(to, notification_mail, params, attachments = [])
  body = notification_mail.apply(params)
  _sendmail(to, notification_mail, body, attachments: attachments)
end