{"action":"created","comment":{"url":"https://api.github.com/repos/ryanb/letter_opener/pulls/comments/240032803","pull_request_review_id":182974318,"id":240032803,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDAzMjgwMw==","diff_hunk":"@@ -26,12 +26,16 @@ def deliver!(mail)\n \n     private\n \n+    def mail_missing_bcc?(mail)\n+      mail.bcc.nil? || mail.bcc.empty?\n+    end\n+\n     def validate_mail!(mail)\n       if !mail.smtp_envelope_from || mail.smtp_envelope_from.empty?\n         raise ArgumentError, \"SMTP From address may not be blank\"\n       end\n \n-      if !mail.smtp_envelope_to || mail.smtp_envelope_to.empty?\n+      if !mail.smtp_envelope_to || (mail.smtp_envelope_to.empty? && mail_missing_bcc?(mail))\n         raise ArgumentError, \"SMTP To address may not be blank\"","path":"lib/letter_opener/delivery_method.rb","position":15,"original_position":15,"commit_id":"fd0e5157d9c6d185f2653081c05d284ac47fa99a","original_commit_id":"fd0e5157d9c6d185f2653081c05d284ac47fa99a","user":{"login":"nashby","id":200500,"node_id":"MDQ6VXNlcjIwMDUwMA==","avatar_url":"https://avatars1.githubusercontent.com/u/200500?v=4","gravatar_id":"","url":"https://api.github.com/users/nashby","html_url":"https://github.com/nashby","followers_url":"https://api.github.com/users/nashby/followers","following_url":"https://api.github.com/users/nashby/following{/other_user}","gists_url":"https://api.github.com/users/nashby/gists{/gist_id}","starred_url":"https://api.github.com/users/nashby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nashby/subscriptions","organizations_url":"https://api.github.com/users/nashby/orgs","repos_url":"https://api.github.com/users/nashby/repos","events_url":"https://api.github.com/users/nashby/events{/privacy}","received_events_url":"https://api.github.com/users/nashby/received_events","type":"User","site_admin":false},"body":"can you please update this error message as well?","created_at":"2018-12-09T11:14:20Z","updated_at":"2018-12-09T11:14:20Z","html_url":"https://github.com/ryanb/letter_opener/pull/158#discussion_r240032803","pull_request_url":"https://api.github.com/repos/ryanb/letter_opener/pulls/158","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ryanb/letter_opener/pulls/comments/240032803"},"html":{"href":"https://github.com/ryanb/letter_opener/pull/158#discussion_r240032803"},"pull_request":{"href":"https://api.github.com/repos/ryanb/letter_opener/pulls/158"}}},"pull_request":{"url":"https://api.github.com/repos/ryanb/letter_opener/pulls/158","id":236286078,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2Mjg2MDc4","html_url":"https://github.com/ryanb/letter_opener/pull/158","diff_url":"https://github.com/ryanb/letter_opener/pull/158.diff","patch_url":"https://github.com/ryanb/letter_opener/pull/158.patch","issue_url":"https://api.github.com/repos/ryanb/letter_opener/issues/158","number":158,"state":"open","locked":false,"title":"Support sending emails with only the BCC field populated","user":{"login":"kylekeesling","id":103486,"node_id":"MDQ6VXNlcjEwMzQ4Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/103486?v=4","gravatar_id":"","url":"https://api.github.com/users/kylekeesling","html_url":"https://github.com/kylekeesling","followers_url":"https://api.github.com/users/kylekeesling/followers","following_url":"https://api.github.com/users/kylekeesling/following{/other_user}","gists_url":"https://api.github.com/users/kylekeesling/gists{/gist_id}","starred_url":"https://api.github.com/users/kylekeesling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylekeesling/subscriptions","organizations_url":"https://api.github.com/users/kylekeesling/orgs","repos_url":"https://api.github.com/users/kylekeesling/repos","events_url":"https://api.github.com/users/kylekeesling/events{/privacy}","received_events_url":"https://api.github.com/users/kylekeesling/received_events","type":"User","site_admin":false},"body":"I have a situation where I want to send emails but protect all of the sender email addresses, hence BCCing everyone, but I noticed that the validation for this gem currently doesn't support that.\r\n\r\nI've added an extra private method the check if the BCC is set and then adapted the smtp_envelope_to check to also take into account whether the BCC is set.\r\n\r\nI've also added an additional spec that checks for this condition, and have been using the gem on my personal projects without any problems.\r\n\r\nPlease let me know how else I can help out or improve this PR.","created_at":"2018-12-05T18:58:06Z","updated_at":"2018-12-09T11:14:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"36e2f2927d5aebfd1a77cf94c581fc5af2b76770","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ryanb/letter_opener/pulls/158/commits","review_comments_url":"https://api.github.com/repos/ryanb/letter_opener/pulls/158/comments","review_comment_url":"https://api.github.com/repos/ryanb/letter_opener/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ryanb/letter_opener/issues/158/comments","statuses_url":"https://api.github.com/repos/ryanb/letter_opener/statuses/fd0e5157d9c6d185f2653081c05d284ac47fa99a","head":{"label":"kylekeesling:bcc-only","ref":"bcc-only","sha":"fd0e5157d9c6d185f2653081c05d284ac47fa99a","user":{"login":"kylekeesling","id":103486,"node_id":"MDQ6VXNlcjEwMzQ4Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/103486?v=4","gravatar_id":"","url":"https://api.github.com/users/kylekeesling","html_url":"https://github.com/kylekeesling","followers_url":"https://api.github.com/users/kylekeesling/followers","following_url":"https://api.github.com/users/kylekeesling/following{/other_user}","gists_url":"https://api.github.com/users/kylekeesling/gists{/gist_id}","starred_url":"https://api.github.com/users/kylekeesling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylekeesling/subscriptions","organizations_url":"https://api.github.com/users/kylekeesling/orgs","repos_url":"https://api.github.com/users/kylekeesling/repos","events_url":"https://api.github.com/users/kylekeesling/events{/privacy}","received_events_url":"https://api.github.com/users/kylekeesling/received_events","type":"User","site_admin":false},"repo":{"id":160561001,"node_id":"MDEwOlJlcG9zaXRvcnkxNjA1NjEwMDE=","name":"letter_opener","full_name":"kylekeesling/letter_opener","private":false,"owner":{"login":"kylekeesling","id":103486,"node_id":"MDQ6VXNlcjEwMzQ4Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/103486?v=4","gravatar_id":"","url":"https://api.github.com/users/kylekeesling","html_url":"https://github.com/kylekeesling","followers_url":"https://api.github.com/users/kylekeesling/followers","following_url":"https://api.github.com/users/kylekeesling/following{/other_user}","gists_url":"https://api.github.com/users/kylekeesling/gists{/gist_id}","starred_url":"https://api.github.com/users/kylekeesling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylekeesling/subscriptions","organizations_url":"https://api.github.com/users/kylekeesling/orgs","repos_url":"https://api.github.com/users/kylekeesling/repos","events_url":"https://api.github.com/users/kylekeesling/events{/privacy}","received_events_url":"https://api.github.com/users/kylekeesling/received_events","type":"User","site_admin":false},"html_url":"https://github.com/kylekeesling/letter_opener","description":"Preview mail in the browser instead of sending.","fork":true,"url":"https://api.github.com/repos/kylekeesling/letter_opener","forks_url":"https://api.github.com/repos/kylekeesling/letter_opener/forks","keys_url":"https://api.github.com/repos/kylekeesling/letter_opener/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kylekeesling/letter_opener/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kylekeesling/letter_opener/teams","hooks_url":"https://api.github.com/repos/kylekeesling/letter_opener/hooks","issue_events_url":"https://api.github.com/repos/kylekeesling/letter_opener/issues/events{/number}","events_url":"https://api.github.com/repos/kylekeesling/letter_opener/events","assignees_url":"https://api.github.com/repos/kylekeesling/letter_opener/assignees{/user}","branches_url":"https://api.github.com/repos/kylekeesling/letter_opener/branches{/branch}","tags_url":"https://api.github.com/repos/kylekeesling/letter_opener/tags","blobs_url":"https://api.github.com/repos/kylekeesling/letter_opener/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kylekeesling/letter_opener/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kylekeesling/letter_opener/git/refs{/sha}","trees_url":"https://api.github.com/repos/kylekeesling/letter_opener/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kylekeesling/letter_opener/statuses/{sha}","languages_url":"https://api.github.com/repos/kylekeesling/letter_opener/languages","stargazers_url":"https://api.github.com/repos/kylekeesling/letter_opener/stargazers","contributors_url":"https://api.github.com/repos/kylekeesling/letter_opener/contributors","subscribers_url":"https://api.github.com/repos/kylekeesling/letter_opener/subscribers","subscription_url":"https://api.github.com/repos/kylekeesling/letter_opener/subscription","commits_url":"https://api.github.com/repos/kylekeesling/letter_opener/commits{/sha}","git_commits_url":"https://api.github.com/repos/kylekeesling/letter_opener/git/commits{/sha}","comments_url":"https://api.github.com/repos/kylekeesling/letter_opener/comments{/number}","issue_comment_url":"https://api.github.com/repos/kylekeesling/letter_opener/issues/comments{/number}","contents_url":"https://api.github.com/repos/kylekeesling/letter_opener/contents/{+path}","compare_url":"https://api.github.com/repos/kylekeesling/letter_opener/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kylekeesling/letter_opener/merges","archive_url":"https://api.github.com/repos/kylekeesling/letter_opener/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kylekeesling/letter_opener/downloads","issues_url":"https://api.github.com/repos/kylekeesling/letter_opener/issues{/number}","pulls_url":"https://api.github.com/repos/kylekeesling/letter_opener/pulls{/number}","milestones_url":"https://api.github.com/repos/kylekeesling/letter_opener/milestones{/number}","notifications_url":"https://api.github.com/repos/kylekeesling/letter_opener/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kylekeesling/letter_opener/labels{/name}","releases_url":"https://api.github.com/repos/kylekeesling/letter_opener/releases{/id}","deployments_url":"https://api.github.com/repos/kylekeesling/letter_opener/deployments","created_at":"2018-12-05T18:26:56Z","updated_at":"2018-12-05T18:26:59Z","pushed_at":"2018-12-05T18:47:36Z","git_url":"git://github.com/kylekeesling/letter_opener.git","ssh_url":"git@github.com:kylekeesling/letter_opener.git","clone_url":"https://github.com/kylekeesling/letter_opener.git","svn_url":"https://github.com/kylekeesling/letter_opener","homepage":"","size":167,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ryanb:master","ref":"master","sha":"52787d3d43761a2125649848afc7c84dd6e67abb","user":{"login":"ryanb","id":161,"node_id":"MDQ6VXNlcjE2MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/161?v=4","gravatar_id":"","url":"https://api.github.com/users/ryanb","html_url":"https://github.com/ryanb","followers_url":"https://api.github.com/users/ryanb/followers","following_url":"https://api.github.com/users/ryanb/following{/other_user}","gists_url":"https://api.github.com/users/ryanb/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanb/subscriptions","organizations_url":"https://api.github.com/users/ryanb/orgs","repos_url":"https://api.github.com/users/ryanb/repos","events_url":"https://api.github.com/users/ryanb/events{/privacy}","received_events_url":"https://api.github.com/users/ryanb/received_events","type":"User","site_admin":false},"repo":{"id":2344621,"node_id":"MDEwOlJlcG9zaXRvcnkyMzQ0NjIx","name":"letter_opener","full_name":"ryanb/letter_opener","private":false,"owner":{"login":"ryanb","id":161,"node_id":"MDQ6VXNlcjE2MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/161?v=4","gravatar_id":"","url":"https://api.github.com/users/ryanb","html_url":"https://github.com/ryanb","followers_url":"https://api.github.com/users/ryanb/followers","following_url":"https://api.github.com/users/ryanb/following{/other_user}","gists_url":"https://api.github.com/users/ryanb/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanb/subscriptions","organizations_url":"https://api.github.com/users/ryanb/orgs","repos_url":"https://api.github.com/users/ryanb/repos","events_url":"https://api.github.com/users/ryanb/events{/privacy}","received_events_url":"https://api.github.com/users/ryanb/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ryanb/letter_opener","description":"Preview mail in the browser instead of sending.","fork":false,"url":"https://api.github.com/repos/ryanb/letter_opener","forks_url":"https://api.github.com/repos/ryanb/letter_opener/forks","keys_url":"https://api.github.com/repos/ryanb/letter_opener/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ryanb/letter_opener/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ryanb/letter_opener/teams","hooks_url":"https://api.github.com/repos/ryanb/letter_opener/hooks","issue_events_url":"https://api.github.com/repos/ryanb/letter_opener/issues/events{/number}","events_url":"https://api.github.com/repos/ryanb/letter_opener/events","assignees_url":"https://api.github.com/repos/ryanb/letter_opener/assignees{/user}","branches_url":"https://api.github.com/repos/ryanb/letter_opener/branches{/branch}","tags_url":"https://api.github.com/repos/ryanb/letter_opener/tags","blobs_url":"https://api.github.com/repos/ryanb/letter_opener/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ryanb/letter_opener/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ryanb/letter_opener/git/refs{/sha}","trees_url":"https://api.github.com/repos/ryanb/letter_opener/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ryanb/letter_opener/statuses/{sha}","languages_url":"https://api.github.com/repos/ryanb/letter_opener/languages","stargazers_url":"https://api.github.com/repos/ryanb/letter_opener/stargazers","contributors_url":"https://api.github.com/repos/ryanb/letter_opener/contributors","subscribers_url":"https://api.github.com/repos/ryanb/letter_opener/subscribers","subscription_url":"https://api.github.com/repos/ryanb/letter_opener/subscription","commits_url":"https://api.github.com/repos/ryanb/letter_opener/commits{/sha}","git_commits_url":"https://api.github.com/repos/ryanb/letter_opener/git/commits{/sha}","comments_url":"https://api.github.com/repos/ryanb/letter_opener/comments{/number}","issue_comment_url":"https://api.github.com/repos/ryanb/letter_opener/issues/comments{/number}","contents_url":"https://api.github.com/repos/ryanb/letter_opener/contents/{+path}","compare_url":"https://api.github.com/repos/ryanb/letter_opener/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ryanb/letter_opener/merges","archive_url":"https://api.github.com/repos/ryanb/letter_opener/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ryanb/letter_opener/downloads","issues_url":"https://api.github.com/repos/ryanb/letter_opener/issues{/number}","pulls_url":"https://api.github.com/repos/ryanb/letter_opener/pulls{/number}","milestones_url":"https://api.github.com/repos/ryanb/letter_opener/milestones{/number}","notifications_url":"https://api.github.com/repos/ryanb/letter_opener/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ryanb/letter_opener/labels{/name}","releases_url":"https://api.github.com/repos/ryanb/letter_opener/releases{/id}","deployments_url":"https://api.github.com/repos/ryanb/letter_opener/deployments","created_at":"2011-09-07T21:17:22Z","updated_at":"2018-12-07T21:22:08Z","pushed_at":"2018-12-05T18:58:07Z","git_url":"git://github.com/ryanb/letter_opener.git","ssh_url":"git@github.com:ryanb/letter_opener.git","clone_url":"https://github.com/ryanb/letter_opener.git","svn_url":"https://github.com/ryanb/letter_opener","homepage":"","size":166,"stargazers_count":2914,"watchers_count":2914,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":199,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":199,"open_issues":2,"watchers":2914,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ryanb/letter_opener/pulls/158"},"html":{"href":"https://github.com/ryanb/letter_opener/pull/158"},"issue":{"href":"https://api.github.com/repos/ryanb/letter_opener/issues/158"},"comments":{"href":"https://api.github.com/repos/ryanb/letter_opener/issues/158/comments"},"review_comments":{"href":"https://api.github.com/repos/ryanb/letter_opener/pulls/158/comments"},"review_comment":{"href":"https://api.github.com/repos/ryanb/letter_opener/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ryanb/letter_opener/pulls/158/commits"},"statuses":{"href":"https://api.github.com/repos/ryanb/letter_opener/statuses/fd0e5157d9c6d185f2653081c05d284ac47fa99a"}},"author_association":"NONE"}}
{"actor":{"display_login":"nashby"}}