{"action":"created","issue":{"url":"https://api.github.com/repos/synapsestudios/oidc-platform/issues/282","repository_url":"https://api.github.com/repos/synapsestudios/oidc-platform","labels_url":"https://api.github.com/repos/synapsestudios/oidc-platform/issues/282/labels{/name}","comments_url":"https://api.github.com/repos/synapsestudios/oidc-platform/issues/282/comments","events_url":"https://api.github.com/repos/synapsestudios/oidc-platform/issues/282/events","html_url":"https://github.com/synapsestudios/oidc-platform/issues/282","id":308113393,"number":282,"title":"Make SES driver support attachments","user":{"login":"agerbens","id":5374685,"avatar_url":"https://avatars2.githubusercontent.com/u/5374685?v=4","gravatar_id":"","url":"https://api.github.com/users/agerbens","html_url":"https://github.com/agerbens","followers_url":"https://api.github.com/users/agerbens/followers","following_url":"https://api.github.com/users/agerbens/following{/other_user}","gists_url":"https://api.github.com/users/agerbens/gists{/gist_id}","starred_url":"https://api.github.com/users/agerbens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agerbens/subscriptions","organizations_url":"https://api.github.com/users/agerbens/orgs","repos_url":"https://api.github.com/users/agerbens/repos","events_url":"https://api.github.com/users/agerbens/events{/privacy}","received_events_url":"https://api.github.com/users/agerbens/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-23T17:15:37Z","updated_at":"2018-03-27T16:27:06Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Currently the mailgun driver supports attachments, but the AWS SES driver does not. \r\n\r\nIt doesn't seem like we can continue using `ses.sendEmail` if we want to be able to handle attachments. If that's the case, then the ses driver's `send` function will have to be updated to use `ses.sendRawEmail`, which looks something like this:\r\n\r\n```\r\nvar ses_mail = \"From: 'Sender' <sender@address.com>\\n\";\r\nses_mail = ses_mail + \"To: recipient@address.com\\n\";\r\nses_mail = ses_mail + \"Subject: Email Subject\\n\";\r\nses_mail = ses_mail + \"MIME-Version: 1.0\\n\";\r\nses_mail = ses_mail + \"Content-Type: multipart/mixed; boundary=\\\"NextPart\\\"\\n\\n\";\r\nses_mail = ses_mail + \"--NextPart\\n\";\r\nses_mail = ses_mail + \"Content-Type: text/html; charset=us-ascii\\n\\n\";\r\nses_mail = ses_mail + \"This is the body of the email.\\n\\n\";\r\nses_mail = ses_mail + \"--NextPart\\n\";\r\nses_mail = ses_mail + \"Content-Type: text/plain;\\n\";\r\nses_mail = ses_mail + \"Content-Disposition: attachment; filename=\\\"attachment.txt\\\"\\n\\n\";\r\nses_mail = ses_mail + \"attachment contents\" + \"\\n\\n\";\r\nses_mail = ses_mail + \"--NextPart--\";\r\n\r\nvar params = {\r\n    RawMessage: { Data: new Buffer(ses_mail) },\r\n    Destinations: [ email ],\r\n    Source: \"Source <\" + email + \">'\"\r\n};\r\n\r\nses.sendRawEmail(params, function(err, data) {\r\n    if(err) {\r\n        res.send(err);\r\n    } \r\n    else {\r\n        res.send(data);\r\n    }           \r\n});\r\n```\r\n\r\nAlternatively, consider using https://nodemailer.com/extras/mailcomposer/ to build the email in a much cleaner / nicer-looking way. "},"comment":{"url":"https://api.github.com/repos/synapsestudios/oidc-platform/issues/comments/376588365","html_url":"https://github.com/synapsestudios/oidc-platform/issues/282#issuecomment-376588365","issue_url":"https://api.github.com/repos/synapsestudios/oidc-platform/issues/282","id":376588365,"user":{"login":"spruce-bruce","id":59978,"avatar_url":"https://avatars0.githubusercontent.com/u/59978?v=4","gravatar_id":"","url":"https://api.github.com/users/spruce-bruce","html_url":"https://github.com/spruce-bruce","followers_url":"https://api.github.com/users/spruce-bruce/followers","following_url":"https://api.github.com/users/spruce-bruce/following{/other_user}","gists_url":"https://api.github.com/users/spruce-bruce/gists{/gist_id}","starred_url":"https://api.github.com/users/spruce-bruce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spruce-bruce/subscriptions","organizations_url":"https://api.github.com/users/spruce-bruce/orgs","repos_url":"https://api.github.com/users/spruce-bruce/repos","events_url":"https://api.github.com/users/spruce-bruce/events{/privacy}","received_events_url":"https://api.github.com/users/spruce-bruce/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T16:27:06Z","updated_at":"2018-03-27T16:27:06Z","author_association":"CONTRIBUTOR","body":"Currently OIDC doesn't ever send attachments, and I don't know of any feature planned that will require sending attachments (which is why I didn't bother supporting attachments when I wrote the SES driver)\r\n\r\nWe could use mailcomposer here and support attachments, but imo not worth even the small amount of effort until we have a use case (unless somebody's really bored and just was looking for something to do)"}}
{"actor":{"display_login":"spruce-bruce"}}