{"action":"created","issue":{"url":"https://api.github.com/repos/simonv3/quick-survey/issues/41","repository_url":"https://api.github.com/repos/simonv3/quick-survey","labels_url":"https://api.github.com/repos/simonv3/quick-survey/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/simonv3/quick-survey/issues/41/comments","events_url":"https://api.github.com/repos/simonv3/quick-survey/issues/41/events","html_url":"https://github.com/simonv3/quick-survey/issues/41","id":171290170,"number":41,"title":"Email notifications of submitted surveys?","user":{"login":"paulhibbitts","id":1812771,"avatar_url":"https://avatars.githubusercontent.com/u/1812771?v=3","gravatar_id":"","url":"https://api.github.com/users/paulhibbitts","html_url":"https://github.com/paulhibbitts","followers_url":"https://api.github.com/users/paulhibbitts/followers","following_url":"https://api.github.com/users/paulhibbitts/following{/other_user}","gists_url":"https://api.github.com/users/paulhibbitts/gists{/gist_id}","starred_url":"https://api.github.com/users/paulhibbitts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulhibbitts/subscriptions","organizations_url":"https://api.github.com/users/paulhibbitts/orgs","repos_url":"https://api.github.com/users/paulhibbitts/repos","events_url":"https://api.github.com/users/paulhibbitts/events{/privacy}","received_events_url":"https://api.github.com/users/paulhibbitts/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-16T00:02:12Z","updated_at":"2016-08-16T02:48:35Z","closed_at":null,"body":"I love Quick-Survey on Sandstorm! I am using it for my university course, and having some sort of email notification of submitted surveys would really help me make sure I am responsive to student submissions. Is this something being considered for the future?\r\n\r\nThanks very much,\r\nPaul"},"comment":{"url":"https://api.github.com/repos/simonv3/quick-survey/issues/comments/239987553","html_url":"https://github.com/simonv3/quick-survey/issues/41#issuecomment-239987553","issue_url":"https://api.github.com/repos/simonv3/quick-survey/issues/41","id":239987553,"user":{"login":"kentonv","id":4001805,"avatar_url":"https://avatars.githubusercontent.com/u/4001805?v=3","gravatar_id":"","url":"https://api.github.com/users/kentonv","html_url":"https://github.com/kentonv","followers_url":"https://api.github.com/users/kentonv/followers","following_url":"https://api.github.com/users/kentonv/following{/other_user}","gists_url":"https://api.github.com/users/kentonv/gists{/gist_id}","starred_url":"https://api.github.com/users/kentonv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentonv/subscriptions","organizations_url":"https://api.github.com/users/kentonv/orgs","repos_url":"https://api.github.com/users/kentonv/repos","events_url":"https://api.github.com/users/kentonv/events{/privacy}","received_events_url":"https://api.github.com/users/kentonv/received_events","type":"User","site_admin":false},"created_at":"2016-08-16T02:48:35Z","updated_at":"2016-08-16T02:48:35Z","body":"@simonv3 This actually shouldn't be too hard now that we bundle node-capnp directly in meteor-spk.\r\n\r\nDo this globally:\r\n\r\n    var Capnp = require(\"capnp\");\r\n    var SandstormHttpBridge = Capnp.importSystem(\"sandstorm/sandstorm-http-bridge.capnp\").SandstormHttpBridge;\r\n    \r\n    var capnpConnection = null;\r\n    var httpBridge = null;\r\n    \r\n    function getHttpBridge() {\r\n      if (!httpBridge) {\r\n        capnpConnection = Capnp.connect(\"unix:/tmp/sandstorm-api\");\r\n        httpBridge = capnpConnection.restore(null, SandstormHttpBridge);\r\n      }\r\n      return httpBridge;\r\n    }\r\n\r\nThen, inside a Meteor method call (so that `this.connection` is available):\r\n\r\n    var sessionId = this.connection.sandstormSessionId()\r\n    \r\n    var context = getHttpBridge().getSessionContext(sessionId).context;\r\n    \r\n    context.send({\r\n      date: Date.now().toString() + \"000000\",\r\n      to: { address: \"whatever@example.com\" },\r\n      messageId: Random.id(),\r\n      subject: \"This is the subject line\"\r\n      text: \"This is the text body\"\r\n      html: \"<p>This is the HTML body (optional)</p>\"\r\n    }).catch(function (err) {\r\n      console.error(\"Failed sending email:\", err.stack);\r\n    });\r\n\r\nDISCLAIMER: I haven't tested the above code. It may need some tweaks."}}
{"actor":{"display_login":"kentonv"}}