Class: Mailtrap::EmailCampaign

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

Overview

Data Transfer Object for Email Campaign

Instance Attribute Summary collapse

Instance Attribute Details

#contact_list_idsArray<Integer> (readonly)

IDs of the contact lists included in the campaign's audience

Returns:

  • (Array<Integer>)

    the current value of contact_list_ids



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def contact_list_ids
  @contact_list_ids
end

#contact_segment_idsArray<Integer> (readonly)

IDs of the contact segments included in the campaign's audience

Returns:

  • (Array<Integer>)

    the current value of contact_segment_ids



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def contact_segment_ids
  @contact_segment_ids
end

#created_atString (readonly)

The creation timestamp

Returns:

  • (String)

    the current value of created_at



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def created_at
  @created_at
end

#current_stateString (readonly)

Lifecycle state (+draft+, scheduled, started, queued, paused, terminating, under_review, finished, failed, failed_immediately)

Returns:

  • (String)

    the current value of current_state



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def current_state
  @current_state
end

#current_state_metadataHash? (readonly)

Metadata about the most recent state transition (+reason+, error, errors as an array of {message, rcpt_index} objects, scheduled_at)

Returns:

  • (Hash, nil)

    the current value of current_state_metadata



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def 
  @current_state_metadata
end

#delivery_modeString (readonly)

How the campaign is delivered (+rapid+ or gradual)

Returns:

  • (String)

    the current value of delivery_mode



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def delivery_mode
  @delivery_mode
end

#delivery_optionsHash? (readonly)

Delivery throttling options (+emails_per_hour+)

Returns:

  • (Hash, nil)

    the current value of delivery_options



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def delivery_options
  @delivery_options
end

#domain_idInteger (readonly)

ID of the sending domain used for the campaign, as returned by the Sending Domains endpoints

Returns:

  • (Integer)

    the current value of domain_id



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def domain_id
  @domain_id
end

#domain_nameString (readonly)

Name of the sending domain used for the campaign

Returns:

  • (String)

    the current value of domain_name



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def domain_name
  @domain_name
end

#from_display_nameString (readonly)

Display name shown in the From header

Returns:

  • (String)

    the current value of from_display_name



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def from_display_name
  @from_display_name
end

#from_local_partString (readonly)

Local part (before the @) of the From address

Returns:

  • (String)

    the current value of from_local_part



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def from_local_part
  @from_local_part
end

#idInteger (readonly)

The email campaign ID

Returns:

  • (Integer)

    the current value of id



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def id
  @id
end

#last_started_atString? (readonly)

When the campaign was last started, or nil

Returns:

  • (String, nil)

    the current value of last_started_at



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def last_started_at
  @last_started_at
end

#last_started_at_dateString? (readonly)

Date the campaign was last started, present only when started

Returns:

  • (String, nil)

    the current value of last_started_at_date



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def last_started_at_date
  @last_started_at_date
end

#nameString (readonly)

Campaign name

Returns:

  • (String)

    the current value of name



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def name
  @name
end

#recipient_total_countInteger? (readonly)

Total number of recipients, or nil until the audience is resolved

Returns:

  • (Integer, nil)

    the current value of recipient_total_count



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def recipient_total_count
  @recipient_total_count
end

#reply_toHash? (readonly)

Reply-To address parts (+display_name+, local_part, domain)

Returns:

  • (Hash, nil)

    the current value of reply_to



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def reply_to
  @reply_to
end

#templateHash? (readonly)

The campaign template (+id+, subject, merge_tags, body_html, body_text; bodies are omitted on list responses)

Returns:

  • (Hash, nil)

    the current value of template



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def template
  @template
end

#updated_atString (readonly)

The last update timestamp

Returns:

  • (String)

    the current value of updated_at



65
66
67
# File 'lib/mailtrap/email_campaign.rb', line 65

def updated_at
  @updated_at
end