Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Knowtify::Client#transactional_email #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions lib/knowtify/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def contacts_create_or_update(contacts=[],request_options={},api_key=nil)
alias :contacts_upsert :contacts_create_or_update

# POST /contacts/delete
# Sends a request to delete contacts whose
# Sends a request to delete contacts whose
# emails match those provided.
# Example contacts:
# [
Expand Down Expand Up @@ -89,19 +89,30 @@ def global_edit(data={},http_request_options={},api_key=nil)
end

# POST contacts/upsert
# Sends a transaction email with the event and contacts provided
# Sends a transactional email with the event and contacts provided. See the full Knowtify API
# documentation at: http://api.knowtify.io/docs/sending-event-based-emails
#
# {
# "event":"purchase",
# "event":"purchase", //this is the tag for the email in Knowtify
# "contacts": [
# {
# "email":"[email protected]"
# }
# ]
# {
# "email":"[email protected]", //this is to whom the email will be delivered
# "data":{
# "PurchasedItem":"Flux Capacitor 2000", //this is all sample data that will populate the body of the email
# "ItemImage":"/fluxcapacitor2000.jpg",
# "ItemDescription": "The most advanced Capacitor yet!",
# "PurchasePrice":"$1,299"
# }
# }
# ]
# }
def transactional_email(event, contacts=[],http_request_options={},api_key=nil)
def transactional_email(event, contacts=[], http_request_options={}, api_key=nil)
options = {
:path => "#{config.base_path}/data/edit",
:params => {:data => contacts},
:path => "#{config.base_path}/contacts/upsert",
:params => {
:event => event,
:contacts => contacts,
},
:http_request_options => http_request_options,
:api_key => api_key
}
Expand Down