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
13
# File 'lib/Mailosaur/models/message_create_options.rb', line 4

def initialize(data = {})
  @to = data['to']
  @cc = data['cc']
  @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.



43
44
45
# File 'lib/Mailosaur/models/message_create_options.rb', line 43

def attachments
  @attachments
end

#ccString

Must be a verified email address.

Returns:

  • (String)

    The email address to which the email will be CC’d.



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

def cc
  @cc
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



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

def from
  @from
end

#htmlString

or html can be supplied, not both.

Returns:

  • (String)

    The HTML body of the email. Note that only text



40
41
42
# File 'lib/Mailosaur/models/message_create_options.rb', line 40

def html
  @html
end

#sendBoolean

Returns If true, email will be sent upon creation.

Returns:

  • (Boolean)

    If true, email will be sent upon creation.



29
30
31
# File 'lib/Mailosaur/models/message_create_options.rb', line 29

def send
  @send
end

#subjectString

Returns The email subject line.

Returns:

  • (String)

    The email subject line.



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

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



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

def text
  @text
end

#toString

Must be a verified email address.

Returns:

  • (String)

    The email address to which the email will be sent.



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

def to
  @to
end