Byte attachments #36

Closed
chrisbrookes opened this Issue Mar 1, 2014 · 3 comments

Projects

None yet

2 participants

@chrisbrookes
Contributor

Hi,

I wanted the ability to attach files that have dynamic content (i.e. created in memory) to an SES email. In my case I need to add a calendar event created on the fly using the ic-alendar grails plugin as an .ics file). Currently there's only support for attaching Files resident on the local file system (and I don't want to go through the messy business of writing out files on the fly).

You can add byte attachments using:

attach "[filename]", "[content type]", [attachment bytes]

E.g.

sesMail {
    from "origin@gmail.com"
    to "test-email@gmail.com"
    subject "test mail with byte attachment"
    attach "filename.txt", "text/plain", "Some text in a file".getBytes('UTF-8')
}

https://github.com/chrisbrookes/grails-aws/tree/byte_attachments

Thanks,
Chris.

@j4y
Member
j4y commented Mar 26, 2014

Please create a pull request and I will merge this in.

@j4y
Member
j4y commented Mar 26, 2014

I merged this in and released 1.6.7.6

@chrisbrookes
Contributor

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment