{"action":"created","comment":{"url":"https://api.github.com/repos/jipiboily/forwardlytics/pulls/comments/79838966","id":79838966,"diff_hunk":"@@ -1,31 +1,129 @@\n package drip\n \n import (\n+\t\"bytes\"\n+\t\"encoding/json\"\n+\t\"errors\"\n+\t\"io/ioutil\"\n+\t\"net/http\"\n+\t\"os\"\n+\t\"time\"\n+\n \t\"github.com/Sirupsen/logrus\"\n \t\"github.com/jipiboily/forwardlytics/integrations\"\n )\n \n // Drip integration\n+type api interface {\n+\tRequest(string, string, []byte) error\n+}\n+\n type Drip struct {\n+\tapi\n+}\n+\n+type DripAPIProduction struct {\n+\tUrl string\n+}\n+\n+type apiSubscriber struct {\n+\tCustomFields map[string]interface{} `json:\"custom_fields\"`\n+\tEmail        string                 `json:\"email\"`\n+\tUserId       string                 `json:\"user_id\"`\n+}\n+\n+type apiEvent struct {\n+\tAction     string                 `json:\"action\"`\n+\tEmail      string                 `json:\"email\"`\n+\tOccurredAt time.Time              `json:\"occurred_at\"`\n+\tProperties map[string]interface{} `json:\"properties\"`\n }\n \n // Identify forwards and identify call to Drip\n-func (Drip) Identify(identification integrations.Identification) (err error) {\n-\tlogrus.Errorf(\"NOT IMPLEMENTED: will send %#v to Drip\\n\", identification)\n+func (d Drip) Identify(identification integrations.Identification) (err error) {\n+\ts := apiSubscriber{}\n+\t// Drip needs an email to identify the user\n+\tif identification.UserTraits[\"email\"] == nil {\n+\t\tlogrus.Error(\"Drip: Required field email is not present\")\n+\t\treturn errors.New(\"Email is required for doing a drip request\")\n+\t} else {\n+\t\ts.Email = identification.UserTraits[\"email\"].(string)\n+\t}\n+\n+\ts.UserId = string(identification.UserID)\n+\n+\t// Add custom attributes\n+\ts.CustomFields = identification.UserTraits","path":"integrations/drip/drip.go","position":58,"original_position":58,"commit_id":"4df06ba2ae691b772c977309c92724f0022a104b","original_commit_id":"3f0a3ba03ccbc6d45b5097fbeac16c8e00057c49","user":{"login":"helgeblod","id":2901515,"avatar_url":"https://avatars.githubusercontent.com/u/2901515?v=3","gravatar_id":"","url":"https://api.github.com/users/helgeblod","html_url":"https://github.com/helgeblod","followers_url":"https://api.github.com/users/helgeblod/followers","following_url":"https://api.github.com/users/helgeblod/following{/other_user}","gists_url":"https://api.github.com/users/helgeblod/gists{/gist_id}","starred_url":"https://api.github.com/users/helgeblod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helgeblod/subscriptions","organizations_url":"https://api.github.com/users/helgeblod/orgs","repos_url":"https://api.github.com/users/helgeblod/repos","events_url":"https://api.github.com/users/helgeblod/events{/privacy}","received_events_url":"https://api.github.com/users/helgeblod/received_events","type":"User","site_admin":false},"body":"This should be fixed now","created_at":"2016-09-21T13:58:24Z","updated_at":"2016-09-21T13:58:24Z","html_url":"https://github.com/jipiboily/forwardlytics/pull/40#discussion_r79838966","pull_request_url":"https://api.github.com/repos/jipiboily/forwardlytics/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/jipiboily/forwardlytics/pulls/comments/79838966"},"html":{"href":"https://github.com/jipiboily/forwardlytics/pull/40#discussion_r79838966"},"pull_request":{"href":"https://api.github.com/repos/jipiboily/forwardlytics/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/jipiboily/forwardlytics/pulls/40","id":84042155,"html_url":"https://github.com/jipiboily/forwardlytics/pull/40","diff_url":"https://github.com/jipiboily/forwardlytics/pull/40.diff","patch_url":"https://github.com/jipiboily/forwardlytics/pull/40.patch","issue_url":"https://api.github.com/repos/jipiboily/forwardlytics/issues/40","number":40,"state":"open","locked":false,"title":"Drip integration added","user":{"login":"helgeblod","id":2901515,"avatar_url":"https://avatars.githubusercontent.com/u/2901515?v=3","gravatar_id":"","url":"https://api.github.com/users/helgeblod","html_url":"https://github.com/helgeblod","followers_url":"https://api.github.com/users/helgeblod/followers","following_url":"https://api.github.com/users/helgeblod/following{/other_user}","gists_url":"https://api.github.com/users/helgeblod/gists{/gist_id}","starred_url":"https://api.github.com/users/helgeblod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helgeblod/subscriptions","organizations_url":"https://api.github.com/users/helgeblod/orgs","repos_url":"https://api.github.com/users/helgeblod/repos","events_url":"https://api.github.com/users/helgeblod/events{/privacy}","received_events_url":"https://api.github.com/users/helgeblod/received_events","type":"User","site_admin":false},"body":"Probably some small stuff that still needs fixing, but as far as I know this works. My Golang skills are still pretty basic, so please comment if there are stuff in here that I should have done differently. ","created_at":"2016-09-05T22:13:36Z","updated_at":"2016-09-21T13:58:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03ab9170c676c3fa7df2a5c5eb9324318bcafc55","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jipiboily/forwardlytics/pulls/40/commits","review_comments_url":"https://api.github.com/repos/jipiboily/forwardlytics/pulls/40/comments","review_comment_url":"https://api.github.com/repos/jipiboily/forwardlytics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jipiboily/forwardlytics/issues/40/comments","statuses_url":"https://api.github.com/repos/jipiboily/forwardlytics/statuses/4df06ba2ae691b772c977309c92724f0022a104b","head":{"label":"helgeblod:master","ref":"master","sha":"4df06ba2ae691b772c977309c92724f0022a104b","user":{"login":"helgeblod","id":2901515,"avatar_url":"https://avatars.githubusercontent.com/u/2901515?v=3","gravatar_id":"","url":"https://api.github.com/users/helgeblod","html_url":"https://github.com/helgeblod","followers_url":"https://api.github.com/users/helgeblod/followers","following_url":"https://api.github.com/users/helgeblod/following{/other_user}","gists_url":"https://api.github.com/users/helgeblod/gists{/gist_id}","starred_url":"https://api.github.com/users/helgeblod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helgeblod/subscriptions","organizations_url":"https://api.github.com/users/helgeblod/orgs","repos_url":"https://api.github.com/users/helgeblod/repos","events_url":"https://api.github.com/users/helgeblod/events{/privacy}","received_events_url":"https://api.github.com/users/helgeblod/received_events","type":"User","site_admin":false},"repo":{"id":66058229,"name":"forwardlytics","full_name":"helgeblod/forwardlytics","owner":{"login":"helgeblod","id":2901515,"avatar_url":"https://avatars.githubusercontent.com/u/2901515?v=3","gravatar_id":"","url":"https://api.github.com/users/helgeblod","html_url":"https://github.com/helgeblod","followers_url":"https://api.github.com/users/helgeblod/followers","following_url":"https://api.github.com/users/helgeblod/following{/other_user}","gists_url":"https://api.github.com/users/helgeblod/gists{/gist_id}","starred_url":"https://api.github.com/users/helgeblod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helgeblod/subscriptions","organizations_url":"https://api.github.com/users/helgeblod/orgs","repos_url":"https://api.github.com/users/helgeblod/repos","events_url":"https://api.github.com/users/helgeblod/events{/privacy}","received_events_url":"https://api.github.com/users/helgeblod/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/helgeblod/forwardlytics","description":"Take events and customer data in and send them to various providers, mostly analytics providers.","fork":true,"url":"https://api.github.com/repos/helgeblod/forwardlytics","forks_url":"https://api.github.com/repos/helgeblod/forwardlytics/forks","keys_url":"https://api.github.com/repos/helgeblod/forwardlytics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/helgeblod/forwardlytics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/helgeblod/forwardlytics/teams","hooks_url":"https://api.github.com/repos/helgeblod/forwardlytics/hooks","issue_events_url":"https://api.github.com/repos/helgeblod/forwardlytics/issues/events{/number}","events_url":"https://api.github.com/repos/helgeblod/forwardlytics/events","assignees_url":"https://api.github.com/repos/helgeblod/forwardlytics/assignees{/user}","branches_url":"https://api.github.com/repos/helgeblod/forwardlytics/branches{/branch}","tags_url":"https://api.github.com/repos/helgeblod/forwardlytics/tags","blobs_url":"https://api.github.com/repos/helgeblod/forwardlytics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/helgeblod/forwardlytics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/helgeblod/forwardlytics/git/refs{/sha}","trees_url":"https://api.github.com/repos/helgeblod/forwardlytics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/helgeblod/forwardlytics/statuses/{sha}","languages_url":"https://api.github.com/repos/helgeblod/forwardlytics/languages","stargazers_url":"https://api.github.com/repos/helgeblod/forwardlytics/stargazers","contributors_url":"https://api.github.com/repos/helgeblod/forwardlytics/contributors","subscribers_url":"https://api.github.com/repos/helgeblod/forwardlytics/subscribers","subscription_url":"https://api.github.com/repos/helgeblod/forwardlytics/subscription","commits_url":"https://api.github.com/repos/helgeblod/forwardlytics/commits{/sha}","git_commits_url":"https://api.github.com/repos/helgeblod/forwardlytics/git/commits{/sha}","comments_url":"https://api.github.com/repos/helgeblod/forwardlytics/comments{/number}","issue_comment_url":"https://api.github.com/repos/helgeblod/forwardlytics/issues/comments{/number}","contents_url":"https://api.github.com/repos/helgeblod/forwardlytics/contents/{+path}","compare_url":"https://api.github.com/repos/helgeblod/forwardlytics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/helgeblod/forwardlytics/merges","archive_url":"https://api.github.com/repos/helgeblod/forwardlytics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/helgeblod/forwardlytics/downloads","issues_url":"https://api.github.com/repos/helgeblod/forwardlytics/issues{/number}","pulls_url":"https://api.github.com/repos/helgeblod/forwardlytics/pulls{/number}","milestones_url":"https://api.github.com/repos/helgeblod/forwardlytics/milestones{/number}","notifications_url":"https://api.github.com/repos/helgeblod/forwardlytics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/helgeblod/forwardlytics/labels{/name}","releases_url":"https://api.github.com/repos/helgeblod/forwardlytics/releases{/id}","deployments_url":"https://api.github.com/repos/helgeblod/forwardlytics/deployments","created_at":"2016-08-19T06:24:37Z","updated_at":"2016-08-19T06:24:38Z","pushed_at":"2016-09-21T13:57:45Z","git_url":"git://github.com/helgeblod/forwardlytics.git","ssh_url":"git@github.com:helgeblod/forwardlytics.git","clone_url":"https://github.com/helgeblod/forwardlytics.git","svn_url":"https://github.com/helgeblod/forwardlytics","homepage":"http://jipiboily.com/","size":654,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jipiboily:master","ref":"master","sha":"89e418bf9d1b5892ecabe93e6f4e3757a00a59b3","user":{"login":"jipiboily","id":232993,"avatar_url":"https://avatars.githubusercontent.com/u/232993?v=3","gravatar_id":"","url":"https://api.github.com/users/jipiboily","html_url":"https://github.com/jipiboily","followers_url":"https://api.github.com/users/jipiboily/followers","following_url":"https://api.github.com/users/jipiboily/following{/other_user}","gists_url":"https://api.github.com/users/jipiboily/gists{/gist_id}","starred_url":"https://api.github.com/users/jipiboily/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jipiboily/subscriptions","organizations_url":"https://api.github.com/users/jipiboily/orgs","repos_url":"https://api.github.com/users/jipiboily/repos","events_url":"https://api.github.com/users/jipiboily/events{/privacy}","received_events_url":"https://api.github.com/users/jipiboily/received_events","type":"User","site_admin":false},"repo":{"id":55230917,"name":"forwardlytics","full_name":"jipiboily/forwardlytics","owner":{"login":"jipiboily","id":232993,"avatar_url":"https://avatars.githubusercontent.com/u/232993?v=3","gravatar_id":"","url":"https://api.github.com/users/jipiboily","html_url":"https://github.com/jipiboily","followers_url":"https://api.github.com/users/jipiboily/followers","following_url":"https://api.github.com/users/jipiboily/following{/other_user}","gists_url":"https://api.github.com/users/jipiboily/gists{/gist_id}","starred_url":"https://api.github.com/users/jipiboily/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jipiboily/subscriptions","organizations_url":"https://api.github.com/users/jipiboily/orgs","repos_url":"https://api.github.com/users/jipiboily/repos","events_url":"https://api.github.com/users/jipiboily/events{/privacy}","received_events_url":"https://api.github.com/users/jipiboily/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jipiboily/forwardlytics","description":"Take events and customer data in and send them to various providers, mostly analytics providers.","fork":false,"url":"https://api.github.com/repos/jipiboily/forwardlytics","forks_url":"https://api.github.com/repos/jipiboily/forwardlytics/forks","keys_url":"https://api.github.com/repos/jipiboily/forwardlytics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jipiboily/forwardlytics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jipiboily/forwardlytics/teams","hooks_url":"https://api.github.com/repos/jipiboily/forwardlytics/hooks","issue_events_url":"https://api.github.com/repos/jipiboily/forwardlytics/issues/events{/number}","events_url":"https://api.github.com/repos/jipiboily/forwardlytics/events","assignees_url":"https://api.github.com/repos/jipiboily/forwardlytics/assignees{/user}","branches_url":"https://api.github.com/repos/jipiboily/forwardlytics/branches{/branch}","tags_url":"https://api.github.com/repos/jipiboily/forwardlytics/tags","blobs_url":"https://api.github.com/repos/jipiboily/forwardlytics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jipiboily/forwardlytics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jipiboily/forwardlytics/git/refs{/sha}","trees_url":"https://api.github.com/repos/jipiboily/forwardlytics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jipiboily/forwardlytics/statuses/{sha}","languages_url":"https://api.github.com/repos/jipiboily/forwardlytics/languages","stargazers_url":"https://api.github.com/repos/jipiboily/forwardlytics/stargazers","contributors_url":"https://api.github.com/repos/jipiboily/forwardlytics/contributors","subscribers_url":"https://api.github.com/repos/jipiboily/forwardlytics/subscribers","subscription_url":"https://api.github.com/repos/jipiboily/forwardlytics/subscription","commits_url":"https://api.github.com/repos/jipiboily/forwardlytics/commits{/sha}","git_commits_url":"https://api.github.com/repos/jipiboily/forwardlytics/git/commits{/sha}","comments_url":"https://api.github.com/repos/jipiboily/forwardlytics/comments{/number}","issue_comment_url":"https://api.github.com/repos/jipiboily/forwardlytics/issues/comments{/number}","contents_url":"https://api.github.com/repos/jipiboily/forwardlytics/contents/{+path}","compare_url":"https://api.github.com/repos/jipiboily/forwardlytics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jipiboily/forwardlytics/merges","archive_url":"https://api.github.com/repos/jipiboily/forwardlytics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jipiboily/forwardlytics/downloads","issues_url":"https://api.github.com/repos/jipiboily/forwardlytics/issues{/number}","pulls_url":"https://api.github.com/repos/jipiboily/forwardlytics/pulls{/number}","milestones_url":"https://api.github.com/repos/jipiboily/forwardlytics/milestones{/number}","notifications_url":"https://api.github.com/repos/jipiboily/forwardlytics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jipiboily/forwardlytics/labels{/name}","releases_url":"https://api.github.com/repos/jipiboily/forwardlytics/releases{/id}","deployments_url":"https://api.github.com/repos/jipiboily/forwardlytics/deployments","created_at":"2016-04-01T12:28:34Z","updated_at":"2016-09-07T03:14:58Z","pushed_at":"2016-09-21T13:57:45Z","git_url":"git://github.com/jipiboily/forwardlytics.git","ssh_url":"git@github.com:jipiboily/forwardlytics.git","clone_url":"https://github.com/jipiboily/forwardlytics.git","svn_url":"https://github.com/jipiboily/forwardlytics","homepage":"http://jipiboily.com/","size":645,"stargazers_count":16,"watchers_count":16,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":12,"forks":4,"open_issues":12,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jipiboily/forwardlytics/pulls/40"},"html":{"href":"https://github.com/jipiboily/forwardlytics/pull/40"},"issue":{"href":"https://api.github.com/repos/jipiboily/forwardlytics/issues/40"},"comments":{"href":"https://api.github.com/repos/jipiboily/forwardlytics/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/jipiboily/forwardlytics/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/jipiboily/forwardlytics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jipiboily/forwardlytics/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/jipiboily/forwardlytics/statuses/4df06ba2ae691b772c977309c92724f0022a104b"}}}}
{"actor":{"display_login":"helgeblod"}}