bigwa420 at gmail
Jul 31, 2012, 10:42 AM
Post #5 of 5
I decided to revisit this idea of including custom field photos in the
Re: Custom Field Attachments to Templates
[In reply to]
resolved email response. I think I am close to a solution but I am getting
hung up on some formatting.
I am able to retrieve the blob data for the LargeContent field and then
base64 encode it. From there I am putting it in to an html email and then
using an <img> tag like this:
The email arrives html formatted but the problem is that there seem to be
newline characters inserted in the base64 encoded blob. The encoded data
seems to be in groups of 989 characters before a new line. I have tried
numerous ways to remove the newlines, but none have worked. I am thinking
that this might have something to do with the Text::Template module?
If I remove the extra whitespace from the email and then save it as html,
the photos will display correctly.
an example of what I am seeing in the html source:
On Wednesday, February 15, 2012, Kevin Falcone wrote:
> On Wed, Feb 15, 2012 at 11:08:09AM -0500, Jeff Ehrenberg wrote:
> > Thanks for the reply Kevin. I am not a developer so I am not sure I
> really understand your
> > answer or where to begin looking. Any additional information on this
> would be great.
> Any solution is going to require significant new code.
> You can view the code I referenced in the 4.2/attach-from-transactions
> branch, which isn't quite ready for merging into master and as I
> mentioned before, won't show up in a core release until 4.2 (assuming
> it's completed).
> > On Friday, February 10, 2012, Kevin Falcone <
> > > On Fri, Feb 10, 2012 at 08:31:49AM -0500, Jeff Ehrenberg wrote:
> > >> I am wondering if it is possible to attach files that have been
> > >> uploaded to custom fields to an email response. We have an upload
> > >> multiple images field and an upload multiple files field that are
> > >> on most tickets. I would like to be able to include the photos and
> > >> pdfs in the resolved email that gets sent to the requestor. I know
> > >> that the blobs are stored in the LargeContent field, but can't
> > >> out how to get them in to the template as attachments. Anyone know
> > >> this is possible?
> > >
> > > Unfortunately - you can't do this easily. You'd need to write your
> > > own subclass of the Notify actions. There is code on a branch off of
> > > the master branch which simplifies some of these code paths, but
> > > won't be in a core release until 4.2.