{"action":"created","issue":{"url":"https://api.github.com/repos/openstax/accounts/issues/160","labels_url":"https://api.github.com/repos/openstax/accounts/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/openstax/accounts/issues/160/comments","events_url":"https://api.github.com/repos/openstax/accounts/issues/160/events","html_url":"https://github.com/openstax/accounts/issues/160","id":63086325,"number":160,"title":"Accounts QA not sending emails","user":{"login":"edwoodward","id":1394695,"avatar_url":"https://avatars.githubusercontent.com/u/1394695?v=3","gravatar_id":"","url":"https://api.github.com/users/edwoodward","html_url":"https://github.com/edwoodward","followers_url":"https://api.github.com/users/edwoodward/followers","following_url":"https://api.github.com/users/edwoodward/following{/other_user}","gists_url":"https://api.github.com/users/edwoodward/gists{/gist_id}","starred_url":"https://api.github.com/users/edwoodward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edwoodward/subscriptions","organizations_url":"https://api.github.com/users/edwoodward/orgs","repos_url":"https://api.github.com/users/edwoodward/repos","events_url":"https://api.github.com/users/edwoodward/events{/privacy}","received_events_url":"https://api.github.com/users/edwoodward/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openstax/accounts/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-19T20:36:37Z","updated_at":"2015-03-19T20:41:33Z","closed_at":null,"body":"I added my other user(ew3) as an author to a Book on dev.cnx.org.  I did not receive an email from Accounts QA.  Chris verified that the API request for the email was sent.\r\n\r\n\r\n     method=POST path=/api/messages.json format=json controller=api/v1/messages  action=create status=422 duration=13.53 view=0.55 db=2.26 params={\"body\"=>{\"text\"=>\"Hello ew3,\\n\\new2 added you to content titled Test Book 3-19.\\nPlease go to the following link to accept your roles and license:\\nhttp://dev.cnx.org/users/role-acceptance/a24fc5f2-b501-4a65-a860-b817287ce410\\n\\nThank you from your friends at OpenStax CNX\\n\", \"html\"=>\"<html><body>Hello ew3,\\n<br/>\\n<br/>ew2 added you to content titled Test Book 3-19.\\n<br/>Please go to the following link to accept your roles and license:\\n<br/>http://dev.cnx.org/users/role-acceptance/a24fc5f2-b501-4a65-a860-b817287ce410\\n<br/>\\n<br/>Thank you from your friends at OpenStax CNX\\n<br/></body></html>\"}, \"to\"=>{\"user_ids\"=>[\"71067\"]}, \"user_id\"=>\"71067\", \"subject\"=>\"Requesting action on OpenStax CNX content\", \"access_token\"=>\"be012cec896491f123500d4d472a29240064d0457ad1638fe0393ea85323cf37\"}\r\n\r\nKaren seemed to think it was being caused by a lack of email verification, but that proved incorrect.\r\n>I looked at accounts_qa database on accounts-qa1.  Ed's users have a\r\n>verified email address:\r\n>\r\n>accounts_qa=> select id, username from users where username = 'ew2' or\r\n>username = 'ew3';\r\n>  id   | username\r\n>-------+----------\r\n> 71066 | ew2\r\n> 71067 | ew3\r\n>(2 rows)\r\n\r\n>accounts_qa=> select value, verified from contact_infos where user_id\r\n>= 71066 or user_id = 71067;\r\n>     value     | verified\r\n>---------------+----------\r\n> ecw1@rice.edu | t\r\n> ecw1@rice.edu | t\r\n>(2 rows)\r\n\r\nChris reported seeing a 422 in the logs\r\n>it contains a '422' status which when googling it means the resource failed validation >\"unprocessable entity\" -- meaning it was looking for some piece of information that it did not get"},"comment":{"url":"https://api.github.com/repos/openstax/accounts/issues/comments/83755041","html_url":"https://github.com/openstax/accounts/issues/160#issuecomment-83755041","issue_url":"https://api.github.com/repos/openstax/accounts/issues/160","id":83755041,"user":{"login":"karenc","id":153353,"avatar_url":"https://avatars.githubusercontent.com/u/153353?v=3","gravatar_id":"","url":"https://api.github.com/users/karenc","html_url":"https://github.com/karenc","followers_url":"https://api.github.com/users/karenc/followers","following_url":"https://api.github.com/users/karenc/following{/other_user}","gists_url":"https://api.github.com/users/karenc/gists{/gist_id}","starred_url":"https://api.github.com/users/karenc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karenc/subscriptions","organizations_url":"https://api.github.com/users/karenc/orgs","repos_url":"https://api.github.com/users/karenc/repos","events_url":"https://api.github.com/users/karenc/events{/privacy}","received_events_url":"https://api.github.com/users/karenc/received_events","type":"User","site_admin":false},"created_at":"2015-03-19T20:41:33Z","updated_at":"2015-03-19T20:41:33Z","body":"It's not email verification in accounts I'm talking about, it's Amazon SES.  Let me paste my whole email:\r\n\r\nI had a look on accounts-qa1.  I tried sending an email using the\r\nApiMailer, and it got rejected by Amazon SES because the email address\r\nis not verified.  I looked here\r\nhttp://docs.aws.amazon.com/ses/latest/DeveloperGuide/ses-errors.html\r\nand I think it's because we're still in sandbox mode.\r\n\r\nShould we go into production mode or add all of us to the list of\r\nverified emails so we can test emails?\r\n\r\n\r\n\r\nThis is what I did on accounts-qa1:\r\n\r\n```\r\n~/www/accounts$ RAILS_ENV=production bundle exec rails console\r\nLoading production environment (Rails 3.2.17)\r\nirb(main):001:0> mail = ApiMailer.mail('<html><body>html\r\nemail</body></html>', 'text email', from:\r\n'karen@e-mail-tester.appspotmail.com', to: 'karen@karen-chan.com', cc:\r\n[], bcc: [], subject: 'test api mailer from accounts-qa1 rails\r\nconsole')\r\n=> #<Mail::Message:42409760, Multipart: true, Headers: <From:\r\nkaren@e-mail-tester.appspotmail.com>, <To: karen@karen-chan.com>, <Cc:\r\n>, <Bcc: >, <Subject: test api mailer from accounts-qa1 rails\r\nconsole>, <Mime-Version: 1.0>, <Content-Type: multipart/alternative;\r\nboundary=\"--==_mimepart_550b2c15b7aa6_26e104cff856993\";\r\ncharset=UTF-8>>\r\nirb(main):002:0> mail.deliver\r\nAWS::SES::ResponseError: AWS::SES Response Error: MessageRejected -\r\nEmail address is not verified.\r\n        from /home/ostaccounts/src/accounts-88a57d0/vendor/bundle/ruby/1.9.1/gems/aws-ses-0.6.0/lib/aws/ses/base.rb:175:in\r\n`request'\r\n        from /home/ostaccounts/src/accounts-88a57d0/vendor/bundle/ruby/1.9.1/gems/aws-ses-0.6.0/lib/aws/ses/send_email.rb:103:in\r\n`send_raw_email'\r\n        from /home/ostaccounts/src/accounts-88a57d0/vendor/bundle/ruby/1.9.1/gems/mail-2.5.4/lib/mail/message.rb:2129:in\r\n`do_delivery'\r\n        from /home/ostaccounts/src/accounts-88a57d0/vendor/bundle/ruby/1.9.1/gems/mail-2.5.4/lib/mail/message.rb:232:in\r\n`block in deliver'\r\n        from /home/ostaccounts/src/accounts-88a57d0/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.17/lib/action_mailer/base.rb:415:in\r\n`block in deliver_mail'\r\n        from /home/ostaccounts/src/accounts-88a57d0/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/notifications.rb:123:in\r\n`block in instrument'\r\n        from /home/ostaccounts/src/accounts-88a57d0/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/notifications/instrumenter.rb:20:in\r\n`instrument'\r\n        from /home/ostaccounts/src/accounts-88a57d0/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/notifications.rb:123:in\r\n`instrument'\r\n        from /home/ostaccounts/src/accounts-88a57d0/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.17/lib/action_mailer/base.rb:413:in\r\n`deliver_mail'\r\n        from /home/ostaccounts/src/accounts-88a57d0/vendor/bundle/ruby/1.9.1/gems/mail-2.5.4/lib/mail/message.rb:232:in\r\n`deliver'\r\n        from (irb):2\r\n        from /home/ostaccounts/src/accounts-88a57d0/vendor/bundle/ruby/1.9.1/gems/railties-3.2.17/lib/rails/commands/console.rb:47:in\r\n`start'\r\n        from /home/ostaccounts/src/accounts-88a57d0/vendor/bundle/ruby/1.9.1/gems/railties-3.2.17/lib/rails/commands/console.rb:8:in\r\n`start'\r\n        from /home/ostaccounts/src/accounts-88a57d0/vendor/bundle/ruby/1.9.1/gems/railties-3.2.17/lib/rails/commands.rb:41:in\r\n`<top (required)>'\r\n        from script/rails:6:in `require'\r\n        from script/rails:6:in `<main>'\r\n```"}}