Class: Mailtrap::MarketingStats

Inherits:
Struct
  • Object
show all
Defined in:
lib/mailtrap/marketing_stats.rb

Overview

Data Transfer Object for Email Marketing Stats

Aggregated metrics of the account's Email Marketing traffic (campaigns and automations) for the requested period and filters. Rates are fractions from 0 to 1. Every count and rate is 0 when nothing matched.

Instance Attribute Summary collapse

Instance Attribute Details

#bounce_count ⇒ Integer (readonly)

Number of bounced messages

Returns:

  • (Integer) —

    the current value of bounce_count



23
24
25
# File 'lib/mailtrap/marketing_stats.rb', line 23

def bounce_count
  @bounce_count
end

#bounce_rate ⇒ Float, Integer (readonly)

Share of sent messages that bounced (0–1)

Returns:

  • (Float, Integer) —

    the current value of bounce_rate



23
24
25
# File 'lib/mailtrap/marketing_stats.rb', line 23

def bounce_rate
  @bounce_rate
end

#click_count ⇒ Integer (readonly)

Number of clicked messages

Returns:

  • (Integer) —

    the current value of click_count



23
24
25
# File 'lib/mailtrap/marketing_stats.rb', line 23

def click_count
  @click_count
end

#click_rate ⇒ Float, Integer (readonly)

Share of delivered messages that were clicked (0–1)

Returns:

  • (Float, Integer) —

    the current value of click_rate



23
24
25
# File 'lib/mailtrap/marketing_stats.rb', line 23

def click_rate
  @click_rate
end

#delivery_count ⇒ Integer (readonly)

Number of delivered messages

Returns:

  • (Integer) —

    the current value of delivery_count



23
24
25
# File 'lib/mailtrap/marketing_stats.rb', line 23

def delivery_count
  @delivery_count
end

#delivery_rate ⇒ Float, Integer (readonly)

Share of sent messages that were delivered (0–1)

Returns:

  • (Float, Integer) —

    the current value of delivery_rate



23
24
25
# File 'lib/mailtrap/marketing_stats.rb', line 23

def delivery_rate
  @delivery_rate
end

#open_count ⇒ Integer (readonly)

Number of opened messages

Returns:

  • (Integer) —

    the current value of open_count



23
24
25
# File 'lib/mailtrap/marketing_stats.rb', line 23

def open_count
  @open_count
end

#open_rate ⇒ Float, Integer (readonly)

Share of delivered messages that were opened (0–1)

Returns:

  • (Float, Integer) —

    the current value of open_rate



23
24
25
# File 'lib/mailtrap/marketing_stats.rb', line 23

def open_rate
  @open_rate
end

#sent_count ⇒ Integer (readonly)

Number of sent messages (delivered plus bounced)

Returns:

  • (Integer) —

    the current value of sent_count



23
24
25
# File 'lib/mailtrap/marketing_stats.rb', line 23

def sent_count
  @sent_count
end

#spam_count ⇒ Integer (readonly)

Number of spam complaints

Returns:

  • (Integer) —

    the current value of spam_count



23
24
25
# File 'lib/mailtrap/marketing_stats.rb', line 23

def spam_count
  @spam_count
end

#spam_rate ⇒ Float, Integer (readonly)

Share of delivered messages marked as spam (0–1)

Returns:

  • (Float, Integer) —

    the current value of spam_rate



23
24
25
# File 'lib/mailtrap/marketing_stats.rb', line 23

def spam_rate
  @spam_rate
end

#unsubscription_count ⇒ Integer (readonly)

Number of unsubscriptions

Returns:

  • (Integer) —

    the current value of unsubscription_count



23
24
25
# File 'lib/mailtrap/marketing_stats.rb', line 23

def unsubscription_count
  @unsubscription_count
end

#unsubscription_rate ⇒ Float, Integer (readonly)

Share of delivered messages that unsubscribed (0–1)

Returns:

  • (Float, Integer) —

    the current value of unsubscription_rate



23
24
25
# File 'lib/mailtrap/marketing_stats.rb', line 23

def unsubscription_rate
  @unsubscription_rate
end