README.md in promoter-0.1.4 vs README.md in promoter-0.1.5

- old
+ new

@@ -1,10 +1,10 @@ # Promoter promoter is a wrapper for the promoter.io REST API. -You can find the promoter.io api docs here: https://promoterio.github.io/api/ +You can find the promoter.io api docs here: http://docs.promoter.apiary.io/ ## Installation First off you need to grab your [promoter.io](http://www.promoter.io) api key. @@ -71,11 +71,35 @@ campaign: 78, # campaign which this belongs to attributes: { plan: 'silver' } # any extra data you want to add to the contact send: false ) # set this to true to send the NPS immediately ``` +### Remove a contact + +```ruby +Promoter::Contact.destroy("chris@lexoo.co.uk") +``` + +### Survey a contact + +```ruby +Promoter::Contact.survey(email: "chris@lexoo.co.uk", # required + first_name: "Chris", # optional + last_name: "O'Sullivan", # optional + campaign: 78, # campaign which this belongs to + attributes: { plan: 'silver' })# any extra data you want to add to the contact +``` + ## Campaigns +### Create a campaign + +```ruby +Promoter::Campaign.create(name: "Campaign Name", # required + contact_list: 1, # required + email: 1) # required +``` + ### Get all campaigns ```ruby Promoter::Campaign.all(2) # => this is paginated - returns page 2 of results ``` @@ -87,10 +111,16 @@ ``` This takes two parameters, the campaign id, and a boolean as to send out surveys to ALL of the customers for the campaign. (This is defaulted to false!) ## Contact lists +### Create a contact list + +```ruby +Promoter::ContactList.create(name: "List Name") # required +``` + ### Get all contact lists ```ruby Promoter::ContactList.all(2) # => this is paginated - returns page 2 of results ``` @@ -105,9 +135,42 @@ ### Remove a contact from a contact list ```ruby Promoter::ContactList.remove_contact(contact_list_id: 7899, contact_id: 15777) +``` + +### Remove a contact from a contact list by email + +```ruby +Promoter::ContactList.remove_contact(email: "me@me.com", + contact_id: 15777) +``` + +### Remove a contact from all contact lists + +```ruby +Promoter::ContactList.remove_contact(contact_id: 15777) +``` + +## Email Templates +### Create an email template + +```ruby +Promoter::EmailTemplate.create(name: "Campaign Name", # required + subject: "Email Name", # required + logo: "<base64EncodedImageData>", # required + reply_to_email: "me@me.com", # required + from_name: "Name", # required + intro_message: "Message", # required + language: "en", # required + company_brand_product_name: "name") # required +``` + +### Get all email templates + +```ruby +Promoter::EmailTemplate.all # => returns all results ``` ## Metrics ```ruby