Class: ConstantContact::Components::Campaign
- Defined in:
- lib/constantcontact/components/email_marketing/campaign.rb
Instance Attribute Summary collapse
-
#click_through_details ⇒ Object
Returns the value of attribute click_through_details.
-
#created_date ⇒ Object
Returns the value of attribute created_date.
-
#email_content ⇒ Object
Returns the value of attribute email_content.
-
#email_content_format ⇒ Object
Returns the value of attribute email_content_format.
-
#from_email ⇒ Object
Returns the value of attribute from_email.
-
#from_name ⇒ Object
Returns the value of attribute from_name.
-
#greeting_name ⇒ Object
Returns the value of attribute greeting_name.
-
#greeting_salutations ⇒ Object
Returns the value of attribute greeting_salutations.
-
#greeting_string ⇒ Object
Returns the value of attribute greeting_string.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_permission_reminder_enabled ⇒ Object
Returns the value of attribute is_permission_reminder_enabled.
-
#is_view_as_webpage_enabled ⇒ Object
Returns the value of attribute is_view_as_webpage_enabled.
-
#last_run_date ⇒ Object
Returns the value of attribute last_run_date.
-
#message_footer ⇒ Object
Returns the value of attribute message_footer.
-
#modified_date ⇒ Object
Returns the value of attribute modified_date.
-
#name ⇒ Object
Returns the value of attribute name.
-
#next_run_date ⇒ Object
Returns the value of attribute next_run_date.
-
#permalink_url ⇒ Object
Returns the value of attribute permalink_url.
-
#permission_reminder_text ⇒ Object
Returns the value of attribute permission_reminder_text.
-
#reply_to_email ⇒ Object
Returns the value of attribute reply_to_email.
-
#sent_to_contact_lists ⇒ Object
Returns the value of attribute sent_to_contact_lists.
-
#status ⇒ Object
Returns the value of attribute status.
-
#style_sheet ⇒ Object
Returns the value of attribute style_sheet.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#template_type ⇒ Object
Returns the value of attribute template_type.
-
#text_content ⇒ Object
Returns the value of attribute text_content.
-
#tracking_summary ⇒ Object
Returns the value of attribute tracking_summary.
-
#view_as_web_page_link_text ⇒ Object
Returns the value of attribute view_as_web_page_link_text.
-
#view_as_web_page_text ⇒ Object
Returns the value of attribute view_as_web_page_text.
Class Method Summary collapse
-
.create(props) ⇒ Campaign
Factory method to create a Campaign object from an array.
-
.create_summary(props) ⇒ Campaign
Factory method to create a Campaign object from an array.
Instance Method Summary collapse
-
#add_list(contact_list) ⇒ Object
Add a contact list to set of lists associated with this email.
Methods inherited from Component
#to_hash, to_hash_value, #to_json
Instance Attribute Details
#click_through_details ⇒ Object
Returns the value of attribute click_through_details
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def click_through_details @click_through_details end |
#created_date ⇒ Object
Returns the value of attribute created_date
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def created_date @created_date end |
#email_content ⇒ Object
Returns the value of attribute email_content
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def email_content @email_content end |
#email_content_format ⇒ Object
Returns the value of attribute email_content_format
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def email_content_format @email_content_format end |
#from_email ⇒ Object
Returns the value of attribute from_email
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def from_email @from_email end |
#from_name ⇒ Object
Returns the value of attribute from_name
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def from_name @from_name end |
#greeting_name ⇒ Object
Returns the value of attribute greeting_name
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def greeting_name @greeting_name end |
#greeting_salutations ⇒ Object
Returns the value of attribute greeting_salutations
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def greeting_salutations @greeting_salutations end |
#greeting_string ⇒ Object
Returns the value of attribute greeting_string
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def greeting_string @greeting_string end |
#id ⇒ Object
Returns the value of attribute id
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def id @id end |
#is_permission_reminder_enabled ⇒ Object
Returns the value of attribute is_permission_reminder_enabled
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def @is_permission_reminder_enabled end |
#is_view_as_webpage_enabled ⇒ Object
Returns the value of attribute is_view_as_webpage_enabled
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def is_view_as_webpage_enabled @is_view_as_webpage_enabled end |
#last_run_date ⇒ Object
Returns the value of attribute last_run_date
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def last_run_date @last_run_date end |
#message_footer ⇒ Object
Returns the value of attribute message_footer
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def @message_footer end |
#modified_date ⇒ Object
Returns the value of attribute modified_date
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def modified_date @modified_date end |
#name ⇒ Object
Returns the value of attribute name
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def name @name end |
#next_run_date ⇒ Object
Returns the value of attribute next_run_date
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def next_run_date @next_run_date end |
#permalink_url ⇒ Object
Returns the value of attribute permalink_url
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def permalink_url @permalink_url end |
#permission_reminder_text ⇒ Object
Returns the value of attribute permission_reminder_text
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def @permission_reminder_text end |
#reply_to_email ⇒ Object
Returns the value of attribute reply_to_email
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def reply_to_email @reply_to_email end |
#sent_to_contact_lists ⇒ Object
Returns the value of attribute sent_to_contact_lists
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def sent_to_contact_lists @sent_to_contact_lists end |
#status ⇒ Object
Returns the value of attribute status
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def status @status end |
#style_sheet ⇒ Object
Returns the value of attribute style_sheet
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def style_sheet @style_sheet end |
#subject ⇒ Object
Returns the value of attribute subject
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def subject @subject end |
#template_type ⇒ Object
Returns the value of attribute template_type
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def template_type @template_type end |
#text_content ⇒ Object
Returns the value of attribute text_content
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def text_content @text_content end |
#tracking_summary ⇒ Object
Returns the value of attribute tracking_summary
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def tracking_summary @tracking_summary end |
#view_as_web_page_link_text ⇒ Object
Returns the value of attribute view_as_web_page_link_text
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def view_as_web_page_link_text @view_as_web_page_link_text end |
#view_as_web_page_text ⇒ Object
Returns the value of attribute view_as_web_page_text
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 10 def view_as_web_page_text @view_as_web_page_text end |
Class Method Details
.create(props) ⇒ Campaign
Factory method to create a Campaign object from an array
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 22 def self.create(props) campaign = Campaign.new if props props.each do |key, value| if key == 'message_footer' campaign. = Components::MessageFooter.create(value) elsif key == 'tracking_summary' campaign.tracking_summary = Components::TrackingSummary.create(value) elsif key == 'sent_to_contact_lists' if value campaign.sent_to_contact_lists = [] value.each do |sent_to_contact_list| campaign.sent_to_contact_lists << Components::ContactList.create(sent_to_contact_list) end end elsif key == 'click_through_details' if value campaign.click_through_details = [] value.each do |click_through_details| campaign.click_through_details << Components::ClickThroughDetails.create(click_through_details) end end else campaign.send("#{key}=", value) if campaign.respond_to? key end end end campaign end |
.create_summary(props) ⇒ Campaign
Factory method to create a Campaign object from an array
56 57 58 59 60 61 62 63 64 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 56 def self.create_summary(props) campaign = Campaign.new if props props.each do |key, value| campaign.send("#{key}=", value) if campaign.respond_to? key end end campaign end |
Instance Method Details
#add_list(contact_list) ⇒ Object
Add a contact list to set of lists associated with this email
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/constantcontact/components/email_marketing/campaign.rb', line 69 def add_list(contact_list) if contact_list.instance_of?(ContactList) list = contact_list elsif contact_list.to_i.to_s == contact_list list = ContactList.new(contact_list) else raise Exceptions::IllegalArgumentException, sprintf(Util::Config.get('errors.id_or_object'), 'ContactList') end @sent_to_contact_lists << list end |