Class: Mailosaur::Models::MessageCreateOptions

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/Mailosaur/models/message_create_options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_json

Constructor Details

#initialize(data = {}) ⇒ MessageCreateOptions

Returns a new instance of MessageCreateOptions.



4
5
6
7
8
9
10
11
12
# File 'lib/Mailosaur/models/message_create_options.rb', line 4

def initialize(data = {})
  @to = data['to']
  @from = data['from']
  @send = data['send']
  @subject = data['subject']
  @text = data['text']
  @html = data['html']
  @attachments = data['attachments']
end

Instance Attribute Details

#attachmentsArray<Attachment>

Returns Any message attachments.

Returns:

  • (Array<Attachment>)

    Any message attachments.



38
39
40
# File 'lib/Mailosaur/models/message_create_options.rb', line 38

def attachments
  @attachments
end

#fromString

‘from’ address. This must be an address ending with ‘YOUR_SERVER.mailosaur.net`, such as `[email protected]`.

Returns:

  • (String)

    Allows for the partial override of the message’s



21
22
23
# File 'lib/Mailosaur/models/message_create_options.rb', line 21

def from
  @from
end

#htmlString

or html can be supplied, not both.

Returns:

  • (String)

    The HTML body of the email. Note that only text



35
36
37
# File 'lib/Mailosaur/models/message_create_options.rb', line 35

def html
  @html
end

#sendBoolean

Returns If true, email will be sent upon creation.

Returns:

  • (Boolean)

    If true, email will be sent upon creation.



24
25
26
# File 'lib/Mailosaur/models/message_create_options.rb', line 24

def send
  @send
end

#subjectString

Returns The email subject line.

Returns:

  • (String)

    The email subject line.



27
28
29
# File 'lib/Mailosaur/models/message_create_options.rb', line 27

def subject
  @subject
end

#textString

text or html can be supplied, not both.

Returns:

  • (String)

    The plain text body of the email. Note that only



31
32
33
# File 'lib/Mailosaur/models/message_create_options.rb', line 31

def text
  @text
end

#toString

Must be a verified email address.

Returns:

  • (String)

    The email address to which the email will be sent.



16
17
18
# File 'lib/Mailosaur/models/message_create_options.rb', line 16

def to
  @to
end