Class: MailUp::Stats::Recipient

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, api) ⇒ Recipient

Returns a new instance of Recipient.



6
7
8
9
# File 'lib/mailup/stats/recipient.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/recipient.rb', line 4

def api
  @api
end

Instance Method Details

#bounces(params = {}) ⇒ JSON

Paged list of bounces returned by the specified recipient.

Examples:


bounces = mailup.console.recipient(154).bounces
bounces['TotalElementsCount']
=> 10
bounces['Items'].first['Subject']
=> "Message Subject"

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:



159
160
161
# File 'lib/mailup/stats/recipient.rb', line 159

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

#bounces_countInteger

Count of bounces returned by the specified recipient.

Examples:


views = mailup.console.recipient(154).bounces_count
=> 324

Returns:

  • (Integer)

    Count of bounces.

See Also:



175
176
177
# File 'lib/mailup/stats/recipient.rb', line 175

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

#bounces_details(params = {}) ⇒ JSON

Paged list of bounces with details returned by the specified recipient.

Examples:


bounces = mailup.console.recipient(154).bounces_details
bounces['TotalElementsCount']
=> 10
bounces['Items'].first['Subject']
=> "Message Subject"

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:



129
130
131
# File 'lib/mailup/stats/recipient.rb', line 129

def bounces_details(params = {})
  @api.get("#{@api.path}/Recipient/#{@id}/List/BouncesDetails", params: params)
end

#clicks(params = {}) ⇒ JSON

Paged list of message clicks on a link done by the specified recipient.

Examples:


clicks = mailup.console.recipient(154).clicks
clicks['TotalElementsCount']
=> 10
clicks['Items'].first['Subject']
=> "Message Subject"

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:



281
282
283
# File 'lib/mailup/stats/recipient.rb', line 281

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

#clicks_countInteger

Count of clicks on a link in the specified email.

Examples:


clicks = mailup.console.recipient(154).clicks_count
=> 324

Returns:

  • (Integer)

    Count of clicks.

See Also:



297
298
299
# File 'lib/mailup/stats/recipient.rb', line 297

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

#clicks_details(params = {}) ⇒ JSON

Verbose paged list of message clicks on a link done by the specified recipient.

Examples:


clicks = mailup.console.recipient(154).clicks_details
clicks['TotalElementsCount']
=> 10
clicks['Items'].first['Subject']
=> "Message Subject"

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:



251
252
253
# File 'lib/mailup/stats/recipient.rb', line 251

def clicks_details(params = {})
  @api.get("#{@api.path}/Recipient/#{@id}/List/ClicksDetails", params: params)
end

#deliveries(params = {}) ⇒ JSON

Paged list of messages received by the specified recipient.

Examples:


deliveries = mailup.console.recipient(154).deliveries
deliveries['TotalElementsCount']
=> 10
deliveries['Items'].first['Subject']
=> "Message Subject"

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/recipient.rb', line 37

def deliveries(params = {})
  @api.get("#{@api.path}/Recipient/#{@id}/List/Deliveries", params: params)
end

#deliveries_countInteger

Count of messages received by the specified recipient.

Examples:


deliveries = mailup.console.recipient(154).deliveries_count
=> 324

Returns:

  • (Integer)

    Count of deliveries.

See Also:



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

def deliveries_count
  @api.get("#{@api.path}/Recipient/#{@id}/Count/Deliveries")
end

#unsubscribes(params = {}) ⇒ JSON

Paged list of unsubscriptions done by the specified recipient.

Examples:


unsubscribes = mailup.console.recipient(154).unsubscribes
unsubscribes['TotalElementsCount']
=> 10
unsubscribes['Items'].first['Subject']
=> "Message Subject"

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:



205
206
207
# File 'lib/mailup/stats/recipient.rb', line 205

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

#unsubscribes_countInteger

Count of unsubscriptions done by the specified recipient.

Examples:


unsubscribes = mailup.console.recipient(154).unsubscribes_count
=> 324

Returns:

  • (Integer)

    Count of unsubscribes.

See Also:



221
222
223
# File 'lib/mailup/stats/recipient.rb', line 221

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

#views(params = {}) ⇒ JSON

Paged list of messages viewed by the specified recipient.

Examples:


views = mailup.console.recipient(154).views
views['TotalElementsCount']
=> 10
views['Items'].first['Subject']
=> "Message Subject"

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:



83
84
85
# File 'lib/mailup/stats/recipient.rb', line 83

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

#views_countInteger

Count of messages viewed by the specified recipient.

Examples:


views = mailup.console.recipient(154).views_count
=> 324

Returns:

  • (Integer)

    Count of views.

See Also:



99
100
101
# File 'lib/mailup/stats/recipient.rb', line 99

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