{"action":"created","comment":{"url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/pulls/comments/38136517","id":38136517,"diff_hunk":"@@ -56,5 +57,21 @@ def to_h\n \n       payload\n     end\n+\n+    private\n+\n+    def template\n+      return if template_id.nil?\n+\n+      @template ||= Template.new(template_id)\n+    end\n+\n+    def smtpapi_json","path":"lib/sendgrid/mail.rb","position":36,"original_position":36,"commit_id":"6478bbb6c45ed0947470cd833cdd0f00b3642937","original_commit_id":"6478bbb6c45ed0947470cd833cdd0f00b3642937","user":{"login":"sashah87","id":924811,"avatar_url":"https://avatars.githubusercontent.com/u/924811?v=3","gravatar_id":"","url":"https://api.github.com/users/sashah87","html_url":"https://github.com/sashah87","followers_url":"https://api.github.com/users/sashah87/followers","following_url":"https://api.github.com/users/sashah87/following{/other_user}","gists_url":"https://api.github.com/users/sashah87/gists{/gist_id}","starred_url":"https://api.github.com/users/sashah87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sashah87/subscriptions","organizations_url":"https://api.github.com/users/sashah87/orgs","repos_url":"https://api.github.com/users/sashah87/repos","events_url":"https://api.github.com/users/sashah87/events{/privacy}","received_events_url":"https://api.github.com/users/sashah87/received_events","type":"User","site_admin":false},"body":"Is this method idempotent?","created_at":"2015-08-27T19:31:37Z","updated_at":"2015-08-27T19:31:37Z","html_url":"https://github.com/apartmentlist/sendgrid-ruby/pull/2#discussion_r38136517","pull_request_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/pulls/comments/38136517"},"html":{"href":"https://github.com/apartmentlist/sendgrid-ruby/pull/2#discussion_r38136517"},"pull_request":{"href":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/pulls/2","id":43466222,"html_url":"https://github.com/apartmentlist/sendgrid-ruby/pull/2","diff_url":"https://github.com/apartmentlist/sendgrid-ruby/pull/2.diff","patch_url":"https://github.com/apartmentlist/sendgrid-ruby/pull/2.patch","issue_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/issues/2","number":2,"state":"open","locked":false,"title":"Add support for templates","user":{"login":"yez","id":638533,"avatar_url":"https://avatars.githubusercontent.com/u/638533?v=3","gravatar_id":"","url":"https://api.github.com/users/yez","html_url":"https://github.com/yez","followers_url":"https://api.github.com/users/yez/followers","following_url":"https://api.github.com/users/yez/following{/other_user}","gists_url":"https://api.github.com/users/yez/gists{/gist_id}","starred_url":"https://api.github.com/users/yez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yez/subscriptions","organizations_url":"https://api.github.com/users/yez/orgs","repos_url":"https://api.github.com/users/yez/repos","events_url":"https://api.github.com/users/yez/events{/privacy}","received_events_url":"https://api.github.com/users/yez/received_events","type":"User","site_admin":false},"body":"@rpdillon @wesdotcool \r\n\r\nThis will add filters to the smtpapi gem:\r\n  https://github.com/sendgrid/smtpapi-ruby\r\n\r\nThe template_id will be passed in like other attributes to mail\r\n\r\nExample:\r\n```ruby\r\n  mail = SendGrid::Mail.new do |m|\r\n    m.to = 'test@sendgrid.com'\r\n    m.from = 'taco@cat.limo'\r\n    m.subject = 'Hello world!'\r\n    m.text = 'I heard you like pineapple.'\r\n    m.template_id = 1234\r\n  end\r\n```","created_at":"2015-08-27T00:01:28Z","updated_at":"2015-08-27T19:31:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"87174eb9896cb8cf5765019335a502a0418c5ee8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/pulls/2/commits","review_comments_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/pulls/2/comments","review_comment_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/issues/2/comments","statuses_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/statuses/6478bbb6c45ed0947470cd833cdd0f00b3642937","head":{"label":"apartmentlist:feature/templating","ref":"feature/templating","sha":"6478bbb6c45ed0947470cd833cdd0f00b3642937","user":{"login":"apartmentlist","id":928486,"avatar_url":"https://avatars.githubusercontent.com/u/928486?v=3","gravatar_id":"","url":"https://api.github.com/users/apartmentlist","html_url":"https://github.com/apartmentlist","followers_url":"https://api.github.com/users/apartmentlist/followers","following_url":"https://api.github.com/users/apartmentlist/following{/other_user}","gists_url":"https://api.github.com/users/apartmentlist/gists{/gist_id}","starred_url":"https://api.github.com/users/apartmentlist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apartmentlist/subscriptions","organizations_url":"https://api.github.com/users/apartmentlist/orgs","repos_url":"https://api.github.com/users/apartmentlist/repos","events_url":"https://api.github.com/users/apartmentlist/events{/privacy}","received_events_url":"https://api.github.com/users/apartmentlist/received_events","type":"Organization","site_admin":false},"repo":{"id":41328616,"name":"sendgrid-ruby","full_name":"apartmentlist/sendgrid-ruby","owner":{"login":"apartmentlist","id":928486,"avatar_url":"https://avatars.githubusercontent.com/u/928486?v=3","gravatar_id":"","url":"https://api.github.com/users/apartmentlist","html_url":"https://github.com/apartmentlist","followers_url":"https://api.github.com/users/apartmentlist/followers","following_url":"https://api.github.com/users/apartmentlist/following{/other_user}","gists_url":"https://api.github.com/users/apartmentlist/gists{/gist_id}","starred_url":"https://api.github.com/users/apartmentlist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apartmentlist/subscriptions","organizations_url":"https://api.github.com/users/apartmentlist/orgs","repos_url":"https://api.github.com/users/apartmentlist/repos","events_url":"https://api.github.com/users/apartmentlist/events{/privacy}","received_events_url":"https://api.github.com/users/apartmentlist/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apartmentlist/sendgrid-ruby","description":"Official Ruby Gem for the SendGrid email Web API.","fork":true,"url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby","forks_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/forks","keys_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/teams","hooks_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/hooks","issue_events_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/events","assignees_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/tags","blobs_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/languages","stargazers_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/stargazers","contributors_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/contributors","subscribers_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/subscribers","subscription_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/subscription","commits_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/merges","archive_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/downloads","issues_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/labels{/name}","releases_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/releases{/id}","created_at":"2015-08-24T21:46:29Z","updated_at":"2015-08-24T21:46:30Z","pushed_at":"2015-08-27T00:01:28Z","git_url":"git://github.com/apartmentlist/sendgrid-ruby.git","ssh_url":"git@github.com:apartmentlist/sendgrid-ruby.git","clone_url":"https://github.com/apartmentlist/sendgrid-ruby.git","svn_url":"https://github.com/apartmentlist/sendgrid-ruby","homepage":"http://sendgrid.com","size":177,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"apartmentlist:master","ref":"master","sha":"38a8de1275c939b396acd913a21c5b7f851b7f53","user":{"login":"apartmentlist","id":928486,"avatar_url":"https://avatars.githubusercontent.com/u/928486?v=3","gravatar_id":"","url":"https://api.github.com/users/apartmentlist","html_url":"https://github.com/apartmentlist","followers_url":"https://api.github.com/users/apartmentlist/followers","following_url":"https://api.github.com/users/apartmentlist/following{/other_user}","gists_url":"https://api.github.com/users/apartmentlist/gists{/gist_id}","starred_url":"https://api.github.com/users/apartmentlist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apartmentlist/subscriptions","organizations_url":"https://api.github.com/users/apartmentlist/orgs","repos_url":"https://api.github.com/users/apartmentlist/repos","events_url":"https://api.github.com/users/apartmentlist/events{/privacy}","received_events_url":"https://api.github.com/users/apartmentlist/received_events","type":"Organization","site_admin":false},"repo":{"id":41328616,"name":"sendgrid-ruby","full_name":"apartmentlist/sendgrid-ruby","owner":{"login":"apartmentlist","id":928486,"avatar_url":"https://avatars.githubusercontent.com/u/928486?v=3","gravatar_id":"","url":"https://api.github.com/users/apartmentlist","html_url":"https://github.com/apartmentlist","followers_url":"https://api.github.com/users/apartmentlist/followers","following_url":"https://api.github.com/users/apartmentlist/following{/other_user}","gists_url":"https://api.github.com/users/apartmentlist/gists{/gist_id}","starred_url":"https://api.github.com/users/apartmentlist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apartmentlist/subscriptions","organizations_url":"https://api.github.com/users/apartmentlist/orgs","repos_url":"https://api.github.com/users/apartmentlist/repos","events_url":"https://api.github.com/users/apartmentlist/events{/privacy}","received_events_url":"https://api.github.com/users/apartmentlist/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apartmentlist/sendgrid-ruby","description":"Official Ruby Gem for the SendGrid email Web API.","fork":true,"url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby","forks_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/forks","keys_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/teams","hooks_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/hooks","issue_events_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/events","assignees_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/tags","blobs_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/languages","stargazers_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/stargazers","contributors_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/contributors","subscribers_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/subscribers","subscription_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/subscription","commits_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/merges","archive_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/downloads","issues_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/labels{/name}","releases_url":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/releases{/id}","created_at":"2015-08-24T21:46:29Z","updated_at":"2015-08-24T21:46:30Z","pushed_at":"2015-08-27T00:01:28Z","git_url":"git://github.com/apartmentlist/sendgrid-ruby.git","ssh_url":"git@github.com:apartmentlist/sendgrid-ruby.git","clone_url":"https://github.com/apartmentlist/sendgrid-ruby.git","svn_url":"https://github.com/apartmentlist/sendgrid-ruby","homepage":"http://sendgrid.com","size":177,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/pulls/2"},"html":{"href":"https://github.com/apartmentlist/sendgrid-ruby/pull/2"},"issue":{"href":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/issues/2"},"comments":{"href":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/apartmentlist/sendgrid-ruby/statuses/6478bbb6c45ed0947470cd833cdd0f00b3642937"}}}}