Class: MailUp::Stats::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/mailup/stats/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, api) ⇒ Message

Returns a new instance of Message.



6
7
8
9
# File 'lib/mailup/stats/message.rb', line 6

def initialize(id, api)
    @api = api
    @id = id
end

Instance Attribute Details

#apiObject

Returns the value of attribute api.



4
5
6
# File 'lib/mailup/stats/message.rb', line 4

def api
  @api
end

Instance Method Details

#bounces(params = {}) ⇒ JSON

Paged list of bounces from the specified email.

Examples:


bounces = mailup.stats.message(9).bounces
bounces['TotalElementsCount']
=> 10

Parameters:

  • params (Hash) (defaults to: {})

    Optional params or filters:

Options Hash (params):

  • :pageNumber (Integer)

    The page number to return.

  • :pageSize (Integer)

    The number of results to per page.

  • :filterby (String)

    A filtering expression.

  • :orderby (String)

    The sorting condition for the results.

Returns:

  • (JSON)

    Results and data including:

    • IsPaginated [Boolean]

    • Items [Array<Hash>]

    • PageNumber [Integer]

    • PageSize [Integer]

    • Skipped [Integer]

    • TotalElementsCount [Integer]

See Also:



126
127
128
# File 'lib/mailup/stats/message.rb', line 126

def bounces(params = {})
  @api.get("#{@api.path}/Message/#{@id}/List/Bounces", params: params)
end

#bounces_countInteger

Count of bounces from the specified mail.

Examples:


bounces = mailup.stats.message(9).bounces_count
=> 3453

Returns:

  • (Integer)

    Count of bounces.

See Also:



142
143
144
# File 'lib/mailup/stats/message.rb', line 142

def bounces_count
  @api.get("#{@api.path}/Message/#{@id}/Count/Bounces")
end

#clicks(params = {}) ⇒ JSON

Paged list of clicks on a link in the specified email.

Examples:


clicks = mailup.stats.message(9).clicks
clicks['TotalElementsCount']
=> 10
clicks['Items'].first['Count']
=> 3

Parameters:

  • params (Hash) (defaults to: {})

    Optional params or filters:

Options Hash (params):

  • :pageNumber (Integer)

    The page number to return.

  • :pageSize (Integer)

    The number of results to per page.

  • :filterby (String)

    A filtering expression.

  • :orderby (String)

    The sorting condition for the results.

Returns:

  • (JSON)

    Results and data including:

    • IsPaginated [Boolean]

    • Items [Array<Hash>]

    • PageNumber [Integer]

    • PageSize [Integer]

    • Skipped [Integer]

    • TotalElementsCount [Integer]

See Also:



216
217
218
# File 'lib/mailup/stats/message.rb', line 216

def clicks(params = {})
  @api.get("#{@api.path}/Message/#{@id}/List/Clicks", params: params)
end

#clicks_countInteger

Count of clicks on a link in the specified email.

Examples:


clicks = mailup.stats.message(9).clicks_count
=> 3453

Returns:

  • (Integer)

    Count of bounces.

See Also:



232
233
234
# File 'lib/mailup/stats/message.rb', line 232

def clicks_count
  @api.get("#{@api.path}/Message/#{@id}/Count/Clicks")
end

#recipients(params = {}) ⇒ JSON

Paged list of recipients who received the specified email.

Examples:


recipients = mailup.stats.message(9).recipients
recipients['TotalElementsCount']
=> 10
recipients['Items'].first['Email']
=> "[email protected]"

Parameters:

  • params (Hash) (defaults to: {})

    Optional params or filters:

Options Hash (params):

  • :pageNumber (Integer)

    The page number to return.

  • :pageSize (Integer)

    The number of results to per page.

  • :filterby (String)

    A filtering expression.

  • :orderby (String)

    The sorting condition for the results.

Returns:

  • (JSON)

    Results and data including:

    • IsPaginated [Boolean]

    • Items [Array<Hash>]

    • PageNumber [Integer]

    • PageSize [Integer]

    • Skipped [Integer]

    • TotalElementsCount [Integer]

See Also:



37
38
39
# File 'lib/mailup/stats/message.rb', line 37

def recipients(params = {})
  @api.get("#{@api.path}/Message/#{@id}/List/Recipients", params: params)
end

#recipients_countInteger Also known as: received_count

Count of recipients who received the specified email.

Examples:


recipients = mailup.stats.message(9).recipients_count
=> 10

Returns:

  • (Integer)

    Count of recipients.

See Also:



53
54
55
# File 'lib/mailup/stats/message.rb', line 53

def recipients_count
  @api.get("#{@api.path}/Message/#{@id}/Count/Recipients")
end

#unsubscribes(params = {}) ⇒ JSON

Paged list of unsubscriptions from the specified email.

Examples:


unsubs = mailup.stats.message(9).unsubscribes
unsubs['TotalElementsCount']
=> 10

Parameters:

  • params (Hash) (defaults to: {})

    Optional params or filters:

Options Hash (params):

  • :pageNumber (Integer)

    The page number to return.

  • :pageSize (Integer)

    The number of results to per page.

  • :filterby (String)

    A filtering expression.

  • :orderby (String)

    The sorting condition for the results.

Returns:

  • (JSON)

    Results and data including:

    • IsPaginated [Boolean]

    • Items [Array<Hash>]

    • PageNumber [Integer]

    • PageSize [Integer]

    • Skipped [Integer]

    • TotalElementsCount [Integer]

See Also:



170
171
172
# File 'lib/mailup/stats/message.rb', line 170

def unsubscribes(params = {})
  @api.get("#{@api.path}/Message/#{@id}/List/Unsubscriptions", params: params)
end

#unsubscribes_countInteger

Count of unsubscriptions from the specified email.

Examples:


unsubs = mailup.stats.message(9).unsubscribes_count
=> 234

Returns:

  • (Integer)

    Count of unsubscribes.

See Also:



186
187
188
# File 'lib/mailup/stats/message.rb', line 186

def unsubscribes_count
  @api.get("#{@api.path}/Message/#{@id}/Count/Unsubscriptions")
end

#url_clicks(params = {}) ⇒ JSON

Paged list of clicks on a link in the specified email.

Examples:


url_clicks = mailup.stats.message(9).url_clicks
url_clicks['TotalElementsCount']
=> 10
url_clicks['Items'].first['Count']
=> 3

Parameters:

  • params (Hash) (defaults to: {})

    Optional params or filters:

Options Hash (params):

  • :pageNumber (Integer)

    The page number to return.

  • :pageSize (Integer)

    The number of results to per page.

  • :filterby (String)

    A filtering expression.

  • :orderby (String)

    The sorting condition for the results.

Returns:

  • (JSON)

    Results and data including:

    • IsPaginated [Boolean]

    • Items [Array<Hash>]

    • PageNumber [Integer]

    • PageSize [Integer]

    • Skipped [Integer]

    • TotalElementsCount [Integer]

See Also:



262
263
264
# File 'lib/mailup/stats/message.rb', line 262

def url_clicks(params = {})
  @api.get("#{@api.path}/Message/#{@id}/List/UrlClicks", params: params)
end

#url_clicks_countInteger

Count of clicks on a link in the specified email.

Examples:


url_clicks = mailup.stats.message(9).url_clicks_count
=> 3453

Returns:

  • (Integer)

    Count of bounces.

See Also:



278
279
280
# File 'lib/mailup/stats/message.rb', line 278

def url_clicks_count
  @api.get("#{@api.path}/Message/#{@id}/Count/UrlClicks")
end

#views(params = {}) ⇒ JSON

Paged list of views of the specified email.

Examples:


views = mailup.stats.message(9).views
views['TotalElementsCount']
=> 10

Parameters:

  • params (Hash) (defaults to: {})

    Optional params or filters:

Options Hash (params):

  • :pageNumber (Integer)

    The page number to return.

  • :pageSize (Integer)

    The number of results to per page.

  • :filterby (String)

    A filtering expression.

  • :orderby (String)

    The sorting condition for the results.

Returns:

  • (JSON)

    Results and data including:

    • IsPaginated [Boolean]

    • Items [Array<Hash>]

    • PageNumber [Integer]

    • PageSize [Integer]

    • Skipped [Integer]

    • TotalElementsCount [Integer]

See Also:



82
83
84
# File 'lib/mailup/stats/message.rb', line 82

def views(params = {})
  @api.get("#{@api.path}/Message/#{@id}/List/Views", params: params)
end

#views_countInteger

Count of views of the specified email.

Examples:


views = mailup.stats.message(9).views_count
=> 3453

Returns:

  • (Integer)

    Count of views.

See Also:



98
99
100
# File 'lib/mailup/stats/message.rb', line 98

def views_count
  @api.get("#{@api.path}/Message/#{@id}/Count/Views")
end