{"action":"opened","issue":{"url":"https://api.github.com/repos/jooby-project/jooby/issues/1204","repository_url":"https://api.github.com/repos/jooby-project/jooby","labels_url":"https://api.github.com/repos/jooby-project/jooby/issues/1204/labels{/name}","comments_url":"https://api.github.com/repos/jooby-project/jooby/issues/1204/comments","events_url":"https://api.github.com/repos/jooby-project/jooby/issues/1204/events","html_url":"https://github.com/jooby-project/jooby/issues/1204","id":339680253,"node_id":"MDU6SXNzdWUzMzk2ODAyNTM=","number":1204,"title":"Send email asynchronously","user":{"login":"nedtwigg","id":2924992,"node_id":"MDQ6VXNlcjI5MjQ5OTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2924992?v=4","gravatar_id":"","url":"https://api.github.com/users/nedtwigg","html_url":"https://github.com/nedtwigg","followers_url":"https://api.github.com/users/nedtwigg/followers","following_url":"https://api.github.com/users/nedtwigg/following{/other_user}","gists_url":"https://api.github.com/users/nedtwigg/gists{/gist_id}","starred_url":"https://api.github.com/users/nedtwigg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nedtwigg/subscriptions","organizations_url":"https://api.github.com/users/nedtwigg/orgs","repos_url":"https://api.github.com/users/nedtwigg/repos","events_url":"https://api.github.com/users/nedtwigg/events{/privacy}","received_events_url":"https://api.github.com/users/nedtwigg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-10T03:29:23Z","updated_at":"2018-07-10T03:29:23Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I'm using `jooby-commons-email`, jooby version `1.3.0`, protocol SMTP to send transactional emails to users.  The problem is that the SMTP call is pretty slow, which makes the server response seem sluggish to the user.\r\n\r\nWhen the user clicks \"Send me an email\", I want to send them a response right away, and send the SMTP email on a different thread.  The downside is that if the email fails to send, it's too late to show that failure to the user, but that's okay.\r\n\r\nI wrote this little module to do that:\r\n\r\nhttps://github.com/mytakedotorg/mytakedotorg/blob/599175f84c74f41864236afafeca22c832609995/server/src/main/java/common/EmailSender.java#L32-L40\r\n\r\nWhich gets used like this:\r\n\r\nhttps://github.com/mytakedotorg/mytakedotorg/blob/526bc65bc79807e13b9505b31ff827834878d97a/server/src/main/java/auth/LoginForm.java#L78-L81\r\n\r\nIt seems to me that the request should be able to serve a response before the email is sent, but the behavior I'm seeing is that it doesn't serve until the email is sent.  Any guesses why?  Does anybody have a better way for serving a response and sending an email without the email blocking the response?\r\n\r\nThanks for any hints :)"}}
{"actor":{"display_login":"nedtwigg"}}