Module: Infusionsoft::Client::Contact
- Included in:
- Infusionsoft::Client
- Defined in:
- lib/infusion-api/client/contact.rb
Overview
Contact service is used to manage contacts. You can add, update and find contacts in addition to managing follow up sequences, tags and action sets.
Instance Method Summary collapse
-
#contact_add(data) ⇒ Integer
Creates a new contact record from the data passed in the associative array.
-
#contact_add_recurring_order(contact_id, allow_duplicate, cprogram_id, merchant_account_id, credit_card_id, affiliate_id, days_till_charge) ⇒ Object
Creates a new recurring order for a contact.
-
#contact_add_to_campaign(contact_id, campaign_id) ⇒ Boolean
Adds a contact to a follow-up sequence (campaigns were the original name of follow-up sequences).
-
#contact_add_to_group(contact_id, group_id) ⇒ Boolean
Adds a tag to a contact.
-
#contact_add_with_dup_check(data, check_type) ⇒ Integer
Adds or updates a contact record based on matching data.
-
#contact_find_by_email(email, selected_fields) ⇒ Array<Hash>
Finds all contacts with the supplied email address in any of the three contact record email addresses.
-
#contact_get_next_campaign_step(contact_id, campaign_id) ⇒ Integer
Returns the Id number of the next follow-up sequence step for the given contact.
- #contact_link_contact(remoteApp, remoteId, localId) ⇒ Object
-
#contact_load(id, selected_fields) ⇒ Array
Loads a contact from the database.
- #contact_locate_contact_link(locate_map_id) ⇒ Object
- #contact_mark_link_updated(locate_map_id) ⇒ Object
-
#contact_pause_campaign(contact_id, campaign_id) ⇒ Boolean
Pauses a follow-up sequence for the given contact record.
-
#contact_remove_from_campaign(contact_id, campaign_id) ⇒ Boolean
Removes a follow-up sequence from a contact record.
-
#contact_remove_from_group(contact_id, group_id) ⇒ Boolean
Removes a tag from a contact (groups were the original name of tags).
-
#contact_reschedule_campaign_step(list_of_contacts, step_id) ⇒ Boolean
Immediately performs the given follow-up sequence step_id for the given contacts.
-
#contact_resume_campaign(contact_id, campaign_id) ⇒ Boolean
Resumes a follow-up sequence that has been stopped/paused for a given contact.
-
#contact_run_action_set(contact_id, action_set_id) ⇒ Array<Hash>
Runs an action set on a given contact record.
-
#contact_run_action_set_with_params(contact_id, action_set_id, data) ⇒ Object
Executes an action sequence for a given contact, passing in runtime params for running affiliate signup actions, etc.
-
#contact_update(contact_id, data) ⇒ Integer
Updates a contact in the database.
Instance Method Details
#contact_add(data) ⇒ Integer
Creates a new contact record from the data passed in the associative array.
12 13 14 15 16 |
# File 'lib/infusion-api/client/contact.rb', line 12 def contact_add(data) contact_id = get('ContactService.add', data) if data.has_key?("Email"); email_optin(data["Email"], "requested information"); end return contact_id end |
#contact_add_recurring_order(contact_id, allow_duplicate, cprogram_id, merchant_account_id, credit_card_id, affiliate_id, days_till_charge) ⇒ Object
Creates a new recurring order for a contact.
169 170 171 172 173 |
# File 'lib/infusion-api/client/contact.rb', line 169 def contact_add_recurring_order(contact_id, allow_duplicate, cprogram_id, merchant_account_id, credit_card_id, affiliate_id, days_till_charge) response = get('ContactService.addRecurringOrder', contact_id, allow_duplicate, cprogram_id, merchant_account_id, credit_card_id, affiliate_id, days_till_charge) end |
#contact_add_to_campaign(contact_id, campaign_id) ⇒ Boolean
Adds a contact to a follow-up sequence (campaigns were the original name of follow-up sequences).
68 69 70 |
# File 'lib/infusion-api/client/contact.rb', line 68 def contact_add_to_campaign(contact_id, campaign_id) response = get('ContactService.addToCampaign', contact_id, campaign_id) end |
#contact_add_to_group(contact_id, group_id) ⇒ Boolean
Adds a tag to a contact
132 133 134 |
# File 'lib/infusion-api/client/contact.rb', line 132 def contact_add_to_group(contact_id, group_id) response = get('ContactService.addToGroup', contact_id, group_id) end |
#contact_add_with_dup_check(data, check_type) ⇒ Integer
Adds or updates a contact record based on matching data
24 25 26 |
# File 'lib/infusion-api/client/contact.rb', line 24 def contact_add_with_dup_check(data, check_type) response = get('ContactService.addWithDupCheck', data, check_type) end |
#contact_find_by_email(email, selected_fields) ⇒ Array<Hash>
Finds all contacts with the supplied email address in any of the three contact record email addresses.
58 59 60 |
# File 'lib/infusion-api/client/contact.rb', line 58 def contact_find_by_email(email, selected_fields) response = get('ContactService.findByEmail', email, selected_fields) end |
#contact_get_next_campaign_step(contact_id, campaign_id) ⇒ Integer
Returns the Id number of the next follow-up sequence step for the given contact.
78 79 80 |
# File 'lib/infusion-api/client/contact.rb', line 78 def contact_get_next_campaign_step(contact_id, campaign_id) response = get('ContactService.getNextCampaignStep', contact_id, campaign_id) end |
#contact_link_contact(remoteApp, remoteId, localId) ⇒ Object
148 149 150 |
# File 'lib/infusion-api/client/contact.rb', line 148 def contact_link_contact(remoteApp, remoteId, localId) response = get('ContactService.linkContact', remoteApp, remoteId, localId) end |
#contact_load(id, selected_fields) ⇒ Array
Loads a contact from the database
48 49 50 |
# File 'lib/infusion-api/client/contact.rb', line 48 def contact_load(id, selected_fields) response = get('ContactService.load', id, selected_fields) end |
#contact_locate_contact_link(locate_map_id) ⇒ Object
153 154 155 |
# File 'lib/infusion-api/client/contact.rb', line 153 def contact_locate_contact_link(locate_map_id) response = get('ContactService.locateContactLink', locate_map_id) end |
#contact_mark_link_updated(locate_map_id) ⇒ Object
157 158 159 |
# File 'lib/infusion-api/client/contact.rb', line 157 def contact_mark_link_updated(locate_map_id) response = get('ContactService.markLinkUpdated', locate_map_id) end |
#contact_pause_campaign(contact_id, campaign_id) ⇒ Boolean
Pauses a follow-up sequence for the given contact record
87 88 89 |
# File 'lib/infusion-api/client/contact.rb', line 87 def contact_pause_campaign(contact_id, campaign_id) response = get('ContactService.pauseCampaign', contact_id, campaign_id) end |
#contact_remove_from_campaign(contact_id, campaign_id) ⇒ Boolean
Removes a follow-up sequence from a contact record
96 97 98 |
# File 'lib/infusion-api/client/contact.rb', line 96 def contact_remove_from_campaign(contact_id, campaign_id) response = get('ContactService.removeFromCampaign', contact_id, campaign_id) end |
#contact_remove_from_group(contact_id, group_id) ⇒ Boolean
Removes a tag from a contact (groups were the original name of tags).
123 124 125 |
# File 'lib/infusion-api/client/contact.rb', line 123 def contact_remove_from_group(contact_id, group_id) response = get('ContactService.removeFromGroup', contact_id, group_id) end |
#contact_reschedule_campaign_step(list_of_contacts, step_id) ⇒ Boolean
Immediately performs the given follow-up sequence step_id for the given contacts.
114 115 116 |
# File 'lib/infusion-api/client/contact.rb', line 114 def contact_reschedule_campaign_step(list_of_contacts, step_id) response = get('ContactService.reschedulteCampaignStep', list_of_contacts, step_id) end |
#contact_resume_campaign(contact_id, campaign_id) ⇒ Boolean
Resumes a follow-up sequence that has been stopped/paused for a given contact.
105 106 107 |
# File 'lib/infusion-api/client/contact.rb', line 105 def contact_resume_campaign(contact_id, campaign_id) response = get('ConactService.resumeCampaignForContact', contact_id, campaign_id) end |
#contact_run_action_set(contact_id, action_set_id) ⇒ Array<Hash>
Runs an action set on a given contact record
144 145 146 |
# File 'lib/infusion-api/client/contact.rb', line 144 def contact_run_action_set(contact_id, action_set_id) response = get('ContactService.runActionSequence', contact_id, action_set_id) end |
#contact_run_action_set_with_params(contact_id, action_set_id, data) ⇒ Object
Executes an action sequence for a given contact, passing in runtime params for running affiliate signup actions, etc
181 182 183 |
# File 'lib/infusion-api/client/contact.rb', line 181 def contact_run_action_set_with_params(contact_id, action_set_id, data) response = get('ContactService.runActionSequence', contact_id, action_set_id, data) end |
#contact_update(contact_id, data) ⇒ Integer
Updates a contact in the database.
35 36 37 38 39 |
# File 'lib/infusion-api/client/contact.rb', line 35 def contact_update(contact_id, data) bool = get('ContactService.update', contact_id, data) if data.has_key?("Email"); email_optin(data["Email"], "requested information"); end return bool end |