Class: Mailjet::Mailer

Inherits:
Mail::SMTP
  • Object
show all
Defined in:
lib/mailjet/mailer.rb

Overview

Mailjet::Mailer enables to send a Mail::Message via Mailjet SMTP relay servers User is the API key, and password the API secret

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mailer

Returns a new instance of Mailer.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/mailjet/mailer.rb', line 10

def initialize(options = {})
  ActionMailer::Base.default(from: Mailjet.config.default_from) if Mailjet.config.default_from.present?
  super({
    address: 'in-v3.mailjet.com',
    port: 587,
    authentication: 'plain',
    user_name: options.delete(:api_key) || Mailjet.config.api_key,
    password: options.delete(:secret_key) || Mailjet.config.secret_key,
    enable_starttls_auto: true
  }.merge!(options))
end