Class: Courrier::Email::Providers::Mailjet

Inherits:
Base
  • Object
show all
Defined in:
lib/courrier/email/providers/mailjet.rb

Constant Summary collapse

ENDPOINT_URL =
"https://api.mailjet.com/v3.1/send"

Instance Method Summary collapse

Methods inherited from Base

#deliver, #initialize

Constructor Details

This class inherits a constructor from Courrier::Email::Providers::Base

Instance Method Details

#bodyObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/courrier/email/providers/mailjet.rb', line 9

def body
  {
    "Messages" => [
      {
        "From" => {
          "Email" => @options.from
        },

        "To" => [
          {
            "Email" => @options.to
          }
        ],
        "ReplyTo" => reply_to_object,

        "Subject" => @options.subject,
        "TextPart" => @options.text,
        "HTMLPart" => @options.html
      }.compact
    ]
  }
end