class SendWithUsMailer::MailParams

Attributes

email_data[R]
email_id[R]
from[R]
to[R]

Public Instance Methods

deliver() click to toggle source

Invoke SendWithUs::Api to deliver the message. The SendWithUs module is implemented in the send_with_us gem.

IMPORTANT NOTE: SendWithUs must be configured prior to calling this method. In particular, the api_key must be set (following the guidelines in the send_with_us documentation).

# File lib/sendwithus_ruby_action_mailer/mail_params.rb, line 66
def deliver
  SendWithUs::Api.new.send_email(
    @email_id,
    @to,
    data: @email_data,
    from: @from,
    cc: @cc,
    bcc: @bcc,
    esp_account: @esp_account,
    version_name: @version_name,
    locale: @locale,
    files: @files,
    headers: @headers,
    tags: @tags
  ) if @email_id.present?
end
Also aliased as: deliver_now
deliver_later(options = {}) click to toggle source

Invoke SendWithUs::Api to deliver the message later via ActiveJob. The SendWithUs module is implemented in the send_with_us gem.

IMPORTANT NOTE: SendWithUs must be configured prior to calling this method. In particular, the api_key must be set (following the guidelines in the send_with_us documentation).

# File lib/sendwithus_ruby_action_mailer/mail_params.rb, line 91
def deliver_later(options = {})
  Jobs::MailJob.set(options).perform_later(
      @email_id,
      @to,
      data: @email_data,
      from: @from,
      cc: @cc,
      bcc: @bcc,
      esp_account: @esp_account,
      version_name: @version_name,
      locale: @locale,
      files: @files,
      headers: @headers,
      tags: @tags
  ) if @email_id.present?
end
deliver_now()
Alias for: deliver