Module: JetEmail::Emails

Defined in:
lib/jetemail/emails.rb

Class Method Summary collapse

Class Method Details

.send(params) ⇒ Hash

Send a single email.

Parameters:

  • params (Hash) —

    Email parameters

Options Hash (params):

  • :from (String) —

    Required. Sender in "Name " format

  • :to (String, Array<String>) —

    Required. Recipient(s), max 50

  • :subject (String) —

    Required. Email subject

  • :html (String) —

    HTML body (at least one of html/text required)

  • :text (String) —

    Plain text body

  • :cc (String, Array<String>) —

    CC recipient(s), max 50

  • :bcc (String, Array<String>) —

    BCC recipient(s), max 50

  • :reply_to (String, Array<String>) —

    Reply-to address(es), max 50

  • :headers (Hash) —

    Custom email headers

  • :attachments (Array<Hash>) —

    File attachments (base64-encoded)

  • :eu (Boolean) —

    EU-only delivery

Returns:

  • (Hash) —

    Response with :id and :response keys



21
22
23
24
# File 'lib/jetemail/emails.rb', line 21

def send(params)
  path = "email"
  JetEmail::Request.new(path, params, "post").perform
end