{"action":"created","comment":{"url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/pulls/comments/23330301","id":23330301,"diff_hunk":"@@ -23,41 +23,104 @@ def initialize(options = {})\n       @configuration = SendWithUs::Config.new(settings)\n     end\n \n-    def send_with(email_id, to, data = {}, from = {}, cc = {}, bcc = {}, files = [], esp_account = '', version_name = '', headers = {}, tags = [])\n+    # DEPRECATED: Please use 'send_email' instead.\n+    #\n+    # Sends the specified email with any arguments.\n+    #\n+    # * *Args*    :\n+    #   - +email_id+ -> ID of the email to send\n+    #   - +to+ -> Hash of recipient details\n+    #   - +data+ -> Hash of email data\n+    #   - +from+ -> Hash of sender details\n+    #   - +cc+ -> Array of CC recipients\n+    #   - +bcc+ -> Array of BCC recipients\n+    #   - +files+ -> Array of attachments\n+    #   - +esp_account+ -> The ESP account to use\n+    #   - +version_name+ -> The specific email version to use\n+    #   - +headers+ -> Hash of headers\n+    #   - +tags+ -> Array of tags\n+    # * *Notes*    :\n+    #   - \"send\" is already a ruby-defined method on all classes\n+    #\n+    def send_with(email_id, to, data = {}, from = {}, cc = [], bcc = [], files = [], esp_account = '', version_name = '', headers = {}, tags = [])\n+      warn \"[DEPRECATED] 'send_with' is deprecated.  Please use 'send_email' instead.\"\n+\n+      send_email(\n+        email_id,\n+        to,\n+        data: data,\n+        from: from,\n+        cc: cc,\n+        bcc: bcc,\n+        files: files,\n+        esp_account: esp_account,\n+        version_name: version_name,\n+        headers: headers,\n+        tags: tags\n+      )\n+    end\n \n+    # Sends the specified email with any optional arguments\n+    #\n+    # * *Args*    :\n+    #   - +email_id+ -> ID of the email to send\n+    #   - +to+ -> Hash of recipient details\n+    # * *Options*    :\n+    #   - +:data+ -> Hash of email data\n+    #   - +:from+ -> Hash of sender details\n+    #   - +:cc+ -> Array of CC recipients\n+    #   - +:bcc+ -> Array of BCC recipients\n+    #   - +:files+ -> Array of attachments\n+    #   - +:esp_account+ -> The ESP account to use\n+    #   - +:version_name+ -> The specific email version to use\n+    #   - +:headers+ -> Hash of headers\n+    #   - +:tags+ -> Array of tags\n+    #   - +:locale+ -> Localization string\n+    # * *Notes*    :\n+    #   - \"send\" is already a ruby-defined method on all classes\n+    #\n+    def send_email(email_id, to, options = {})\n       if email_id.nil?\n         raise SendWithUs::ApiNilEmailId, 'email_id cannot be nil'\n       end\n \n-      payload = { email_id: email_id, recipient: to,\n-                  email_data: data }\n+      payload = {\n+        email_id: email_id,\n+        recipient: to\n+      }\n \n-      if from.any?\n-        payload[:sender] = from\n+      if options[:data] && options[:data].any?\n+        payload[:email_data] = options[:data]\n       end\n-      if cc.any?\n-        payload[:cc] = cc\n+      if options[:from] && options[:from].any?\n+        payload[:sender] = options[:from]\n       end\n-      if bcc.any?\n-        payload[:bcc] = bcc\n+      if options[:cc] && options[:cc].any?\n+        payload[:cc] = options[:cc]\n       end\n-      if esp_account\n-        payload[:esp_account] = esp_account\n+      if options[:bcc] && options[:bcc].any?\n+        payload[:bcc] = options[:bcc]\n       end\n-      if version_name\n-        payload[:version_name] = version_name\n+      if options[:esp_account]\n+        payload[:esp_account] = options[:esp_account]\n       end\n-      if headers.any?\n-        payload[:headers] = headers\n+      if options[:version_name]\n+        payload[:version_name] = options[:version_name]\n       end\n-      if tags.any?\n-        payload[:tags] = tags\n+      if options[:headers] && options[:headers].any?\n+        payload[:headers] = options[:headers]\n+      end\n+      if options[:tags] && options[:tags].any?\n+        payload[:tags] = options[:tags]\n+      end\n+      if options[:locale]\n+        payload[:locale] = options[:locale]\n       end\n \n-      if files.any?\n+      if not options[:files].nil? and options[:files].any?","path":"lib/send_with_us/api.rb","position":116,"original_position":116,"commit_id":"bed27ed44b00509ddc0c7463b6257b316dcff2ed","original_commit_id":"bed27ed44b00509ddc0c7463b6257b316dcff2ed","user":{"login":"echobass","id":53410,"avatar_url":"https://avatars.githubusercontent.com/u/53410?v=3","gravatar_id":"","url":"https://api.github.com/users/echobass","html_url":"https://github.com/echobass","followers_url":"https://api.github.com/users/echobass/followers","following_url":"https://api.github.com/users/echobass/following{/other_user}","gists_url":"https://api.github.com/users/echobass/gists{/gist_id}","starred_url":"https://api.github.com/users/echobass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echobass/subscriptions","organizations_url":"https://api.github.com/users/echobass/orgs","repos_url":"https://api.github.com/users/echobass/repos","events_url":"https://api.github.com/users/echobass/events{/privacy}","received_events_url":"https://api.github.com/users/echobass/received_events","type":"User","site_admin":false},"body":"missed this one","created_at":"2015-01-21T20:12:10Z","updated_at":"2015-01-21T20:12:10Z","html_url":"https://github.com/sendwithus/sendwithus_ruby/pull/37#discussion_r23330301","pull_request_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/pulls/37","_links":{"self":{"href":"https://api.github.com/repos/sendwithus/sendwithus_ruby/pulls/comments/23330301"},"html":{"href":"https://github.com/sendwithus/sendwithus_ruby/pull/37#discussion_r23330301"},"pull_request":{"href":"https://api.github.com/repos/sendwithus/sendwithus_ruby/pulls/37"}}},"pull_request":{"url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/pulls/37","id":27724253,"html_url":"https://github.com/sendwithus/sendwithus_ruby/pull/37","diff_url":"https://github.com/sendwithus/sendwithus_ruby/pull/37.diff","patch_url":"https://github.com/sendwithus/sendwithus_ruby/pull/37.patch","issue_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/issues/37","number":37,"state":"open","locked":false,"title":"Locale support and Send method","user":{"login":"echobass","id":53410,"avatar_url":"https://avatars.githubusercontent.com/u/53410?v=3","gravatar_id":"","url":"https://api.github.com/users/echobass","html_url":"https://github.com/echobass","followers_url":"https://api.github.com/users/echobass/followers","following_url":"https://api.github.com/users/echobass/following{/other_user}","gists_url":"https://api.github.com/users/echobass/gists{/gist_id}","starred_url":"https://api.github.com/users/echobass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echobass/subscriptions","organizations_url":"https://api.github.com/users/echobass/orgs","repos_url":"https://api.github.com/users/echobass/repos","events_url":"https://api.github.com/users/echobass/events{/privacy}","received_events_url":"https://api.github.com/users/echobass/received_events","type":"User","site_admin":false},"body":"- Introduce `send_email()` method which uses named arguments (via Ruby 1.9's hash sugar)\r\n- Locale support for new `send_email()` method\r\n- Deprecated `send_with()` method","created_at":"2015-01-20T23:59:53Z","updated_at":"2015-01-21T20:12:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8f291f3cacd57555b7b85d7668bd2535f5f5ef0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/pulls/37/commits","review_comments_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/pulls/37/comments","review_comment_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/pulls/comments/{number}","comments_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/issues/37/comments","statuses_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/statuses/bed27ed44b00509ddc0c7463b6257b316dcff2ed","head":{"label":"sendwithus:locale_support","ref":"locale_support","sha":"bed27ed44b00509ddc0c7463b6257b316dcff2ed","user":{"login":"sendwithus","id":3197391,"avatar_url":"https://avatars.githubusercontent.com/u/3197391?v=3","gravatar_id":"","url":"https://api.github.com/users/sendwithus","html_url":"https://github.com/sendwithus","followers_url":"https://api.github.com/users/sendwithus/followers","following_url":"https://api.github.com/users/sendwithus/following{/other_user}","gists_url":"https://api.github.com/users/sendwithus/gists{/gist_id}","starred_url":"https://api.github.com/users/sendwithus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sendwithus/subscriptions","organizations_url":"https://api.github.com/users/sendwithus/orgs","repos_url":"https://api.github.com/users/sendwithus/repos","events_url":"https://api.github.com/users/sendwithus/events{/privacy}","received_events_url":"https://api.github.com/users/sendwithus/received_events","type":"Organization","site_admin":false},"repo":{"id":7477635,"name":"sendwithus_ruby","full_name":"sendwithus/sendwithus_ruby","owner":{"login":"sendwithus","id":3197391,"avatar_url":"https://avatars.githubusercontent.com/u/3197391?v=3","gravatar_id":"","url":"https://api.github.com/users/sendwithus","html_url":"https://github.com/sendwithus","followers_url":"https://api.github.com/users/sendwithus/followers","following_url":"https://api.github.com/users/sendwithus/following{/other_user}","gists_url":"https://api.github.com/users/sendwithus/gists{/gist_id}","starred_url":"https://api.github.com/users/sendwithus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sendwithus/subscriptions","organizations_url":"https://api.github.com/users/sendwithus/orgs","repos_url":"https://api.github.com/users/sendwithus/repos","events_url":"https://api.github.com/users/sendwithus/events{/privacy}","received_events_url":"https://api.github.com/users/sendwithus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sendwithus/sendwithus_ruby","description":"Sendwithus Ruby Client","fork":false,"url":"https://api.github.com/repos/sendwithus/sendwithus_ruby","forks_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/forks","keys_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/teams","hooks_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/hooks","issue_events_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/issues/events{/number}","events_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/events","assignees_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/assignees{/user}","branches_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/branches{/branch}","tags_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/tags","blobs_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/languages","stargazers_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/stargazers","contributors_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/contributors","subscribers_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/subscribers","subscription_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/subscription","commits_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/issues/comments/{number}","contents_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/contents/{+path}","compare_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/merges","archive_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/downloads","issues_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/issues{/number}","pulls_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/labels{/name}","releases_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/releases{/id}","created_at":"2013-01-07T06:05:07Z","updated_at":"2015-01-06T00:53:15Z","pushed_at":"2015-01-21T20:08:25Z","git_url":"git://github.com/sendwithus/sendwithus_ruby.git","ssh_url":"git@github.com:sendwithus/sendwithus_ruby.git","clone_url":"https://github.com/sendwithus/sendwithus_ruby.git","svn_url":"https://github.com/sendwithus/sendwithus_ruby","homepage":"https://www.sendwithus.com","size":747,"stargazers_count":9,"watchers_count":9,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":1,"forks":21,"open_issues":1,"watchers":9,"default_branch":"master"}},"base":{"label":"sendwithus:master","ref":"master","sha":"8633e2aae6ac155989cef21670844c456e1e5ad6","user":{"login":"sendwithus","id":3197391,"avatar_url":"https://avatars.githubusercontent.com/u/3197391?v=3","gravatar_id":"","url":"https://api.github.com/users/sendwithus","html_url":"https://github.com/sendwithus","followers_url":"https://api.github.com/users/sendwithus/followers","following_url":"https://api.github.com/users/sendwithus/following{/other_user}","gists_url":"https://api.github.com/users/sendwithus/gists{/gist_id}","starred_url":"https://api.github.com/users/sendwithus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sendwithus/subscriptions","organizations_url":"https://api.github.com/users/sendwithus/orgs","repos_url":"https://api.github.com/users/sendwithus/repos","events_url":"https://api.github.com/users/sendwithus/events{/privacy}","received_events_url":"https://api.github.com/users/sendwithus/received_events","type":"Organization","site_admin":false},"repo":{"id":7477635,"name":"sendwithus_ruby","full_name":"sendwithus/sendwithus_ruby","owner":{"login":"sendwithus","id":3197391,"avatar_url":"https://avatars.githubusercontent.com/u/3197391?v=3","gravatar_id":"","url":"https://api.github.com/users/sendwithus","html_url":"https://github.com/sendwithus","followers_url":"https://api.github.com/users/sendwithus/followers","following_url":"https://api.github.com/users/sendwithus/following{/other_user}","gists_url":"https://api.github.com/users/sendwithus/gists{/gist_id}","starred_url":"https://api.github.com/users/sendwithus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sendwithus/subscriptions","organizations_url":"https://api.github.com/users/sendwithus/orgs","repos_url":"https://api.github.com/users/sendwithus/repos","events_url":"https://api.github.com/users/sendwithus/events{/privacy}","received_events_url":"https://api.github.com/users/sendwithus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sendwithus/sendwithus_ruby","description":"Sendwithus Ruby Client","fork":false,"url":"https://api.github.com/repos/sendwithus/sendwithus_ruby","forks_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/forks","keys_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/teams","hooks_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/hooks","issue_events_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/issues/events{/number}","events_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/events","assignees_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/assignees{/user}","branches_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/branches{/branch}","tags_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/tags","blobs_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/languages","stargazers_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/stargazers","contributors_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/contributors","subscribers_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/subscribers","subscription_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/subscription","commits_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/issues/comments/{number}","contents_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/contents/{+path}","compare_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/merges","archive_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/downloads","issues_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/issues{/number}","pulls_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/labels{/name}","releases_url":"https://api.github.com/repos/sendwithus/sendwithus_ruby/releases{/id}","created_at":"2013-01-07T06:05:07Z","updated_at":"2015-01-06T00:53:15Z","pushed_at":"2015-01-21T20:08:25Z","git_url":"git://github.com/sendwithus/sendwithus_ruby.git","ssh_url":"git@github.com:sendwithus/sendwithus_ruby.git","clone_url":"https://github.com/sendwithus/sendwithus_ruby.git","svn_url":"https://github.com/sendwithus/sendwithus_ruby","homepage":"https://www.sendwithus.com","size":747,"stargazers_count":9,"watchers_count":9,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":1,"forks":21,"open_issues":1,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sendwithus/sendwithus_ruby/pulls/37"},"html":{"href":"https://github.com/sendwithus/sendwithus_ruby/pull/37"},"issue":{"href":"https://api.github.com/repos/sendwithus/sendwithus_ruby/issues/37"},"comments":{"href":"https://api.github.com/repos/sendwithus/sendwithus_ruby/issues/37/comments"},"review_comments":{"href":"https://api.github.com/repos/sendwithus/sendwithus_ruby/pulls/37/comments"},"review_comment":{"href":"https://api.github.com/repos/sendwithus/sendwithus_ruby/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/sendwithus/sendwithus_ruby/pulls/37/commits"},"statuses":{"href":"https://api.github.com/repos/sendwithus/sendwithus_ruby/statuses/bed27ed44b00509ddc0c7463b6257b316dcff2ed"}}}}