Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Users

Custom Field Attachments to Templates

 

 

Request Tracker users RSS feed   Index | Next | Previous | View Threaded


bigwa420 at gmail

Feb 10, 2012, 5:31 AM

Post #1 of 5 (859 views)
Permalink
Custom Field Attachments to Templates

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 used
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 figure
out how to get them in to the template as attachments. Anyone know if
this is possible?
Thanks,
Jeff
--------
RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston March 5 & 6, 2012


falcone at bestpractical

Feb 10, 2012, 8:46 AM

Post #2 of 5 (806 views)
Permalink
Re: Custom Field Attachments to Templates [In reply to]

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 used
> 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 figure
> out how to get them in to the template as attachments. Anyone know if
> 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 that
won't be in a core release until 4.2.

-kevin


bigwa420 at gmail

Feb 15, 2012, 8:08 AM

Post #3 of 5 (765 views)
Permalink
Re: Custom Field Attachments to Templates [In reply to]

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.
Thanks,
Jeff

On Friday, February 10, 2012, Kevin Falcone <falcone [at] bestpractical>
wrote:
> 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 used
>> 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 figure
>> out how to get them in to the template as attachments. Anyone know if
>> 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 that
> won't be in a core release until 4.2.
>
> -kevin
>


falcone at bestpractical

Feb 15, 2012, 9:10 AM

Post #4 of 5 (765 views)
Permalink
Re: Custom Field Attachments to Templates [In reply to]

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).

-kevin

>
> On Friday, February 10, 2012, Kevin Falcone <[1]falcone [at] bestpractical> wrote:
> > 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 used
> >> 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 figure
> >> out how to get them in to the template as attachments. Anyone know if
> >> 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 that
> > won't be in a core release until 4.2.


bigwa420 at gmail

Jul 31, 2012, 10:42 AM

Post #5 of 5 (489 views)
Permalink
Re: Custom Field Attachments to Templates [In reply to]

I decided to revisit this idea of including custom field photos in the
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:
<img src="data:image/jpg;base64,
encode_base64($customFieldValue->LargeContent, '')">

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.

Any ideas?
an example of what I am seeing in the html source:
<img
src="data:image/jpg;base64,_9j_4T_-RXhpZgAASUkqAAgAAAAMAA4BAgAgAAAAXAUAAA8BAgAYAAAAfAUAABABAgARAAAAlAUAABIBAwABAAAAAQAAABoBBQABAAAAKAUAABsBBQABAAAAMAUAACgBAwABAAAAAgAAADEBAgAgAAAApgUAADIBAgAUAAAASAUAABMCAwABAAAAAgAAAGmHBAABAAAAngAAAKXEBwAUAgAAyAUAACQCAAAgAJqCBQABAAAAqAgAAJ2CBQABAAAA0AgAACKIAwABAAAAAgAAACeIAwABAAAAZAAAAACQBwAEAAAAMDIyMQOQAgAUAAAAfQgAAASQAgAUAAAAkQgAAAGRBwAEAAAAAQIDAASSCgABAAAAsAgAAAWSBQABAAAAuAgAAAeSAwABAAAABQAAAAiSA
wABAAAAAAAAAAmSAwABAAAAGQAAAAqSBQABAAAAyAgAAHySBwBcHgAAJAkAAIaSBwB9AAAAAAgAAACgBwAEAAAAMDEwMAGgAwABAAAAAQAAAAKgBAABAAAAQAYAAAOgBAABAAAAsAQAAAWgBAABAAAAcgIAAACjBwABAAAAAwAAAAGkAwABAAAAAAAAAAKkAwABAAAAAAAAAAOkAwABAAAAAAAAAASkBQABAAAA5AgAAAWkAwABAAAAJAAAAAakAwABAAAAAAAAAAekAwABAAAAAQAAAAikAwABAAAAAAAAAAmkAwABAAAAAAAAAAqkAwABAAAAAAAAAAAAAAAGAAMBAwABAAAABgAAABoBBQABAAAA_AgAABsBBQABAAAABAkAACgBAwABAAAAAgAAAAECBAABAAAAlCcAAAICBAABAAAA6hYAAAAAAAACAAEAAgAEAAAAUjk4AAIABwAEAAAAMDEwMAAAAADcBwcaByM0AAAAAAARAYAAgQD0AAgAQEAAAP8P_w_PALr_9v_n_78A2P8DAMz_rwAAAAAAAAAAAAAAAAAAAAAAAAAAAKAnAAAAAAIAAAEAAQABAAEAAAAAAAAAAAAAAAAAAAgAAQAIAAAAAAAABAAAAgAAAAAAAAADAAMABgACAAAAAABkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAACLwUAAQALAAUAAAAAJAQkBBIEAACu_sD-hf4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALUKUA4MAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

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).
>
> -kevin
>
> >
> > On Friday, February 10, 2012, Kevin Falcone <[1]
> falcone [at] bestpractical <javascript:;>> wrote:
> > > 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
> used
> > >> 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
> figure
> > >> out how to get them in to the template as attachments. Anyone know
> if
> > >> 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
> that
> > > won't be in a core release until 4.2.
>

Request Tracker users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.