Class: MailUp::Console::Email

Inherits:
Object
  • Object
show all
Defined in:
lib/mailup/console/email.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api) ⇒ Email

Returns a new instance of Email.



6
7
8
# File 'lib/mailup/console/email.rb', line 6

def initialize(api)
    @api = api
end

Instance Attribute Details

#apiObject

Returns the value of attribute api.



4
5
6
# File 'lib/mailup/console/email.rb', line 4

def api
  @api
end

Instance Method Details

#send(message_id, email) ⇒ JSON

Send single email message to specified recipient.

Examples:


send = mailup.console.email.send(5, '[email protected]')
send['Sent']
=> 1

Parameters:

  • message_id (Integer)

    The ID of the message to send.

  • email (String)

    The email address of the recipient.

Returns:

  • (JSON)

    A Send object with the following attributes:

    • idMessage [Integer]

    • Sent [Integer]

    • UnprocessedRecipients [Array]

    • InvalidRecipients [Array]

See Also:



29
30
31
# File 'lib/mailup/console/email.rb', line 29

def send(message_id, email)
  @api.post("#{@api.path}/Email/Send", body: {:idMessage => message_id, :Email => email})
end