function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
thunksalotthunksalot 

Generate PDF Attachment on User Editable Email?

So far, I've only been able to figure out how to generate PDF email attachments that my users can send from an object by embedding the Visualforce code for the PDF within the <messaging:attachment> tag for a Visualforce Email Template.  The downside to this is that the message body of the email is not editable by the user.  This means my generated attachments always get sent with the same impersonal boilerplate message body.

 

I didn't know it was possible to do any better until I got my AppExchange newsletter today and saw the demo of Steel Brick's QuoteQuickly app.  I was surprised to see at the 1:30 mark of the video's second part that they claim they are using Force.com's built-in Send Email functionality to send quotes - and then they show the Send Email form load with an editable message body AND with their generated PDF already attached.  

 

How are they doing that?  Anybody know or have a guess?  

 

Unfortunately, QuoteQuickly doesn't meet my needs, so I need to figure out how to replicate that functionality.

 

Much thanks in advance for any assistance!

Best Answer chosen by Admin (Salesforce Developers) 
thunksalotthunksalot

I think I just figured it out.  My problem is that I've been trying to get user editability while using the <messaging:htmlEmailBody> tag.  I forgot that user editability has always been available with the <messaging:plainTextEmailBody> tag, even when an attachment is appended with the <messaging:attachment> tag.  

 

The reason I've been trying to use the HTML body is because my organization is really big on branding - which requires putting our logo in everyone's email signature blocks.  Anybody know a way I could achieve that while still having a user editable email message body?  It seems impossible, but maybe somebody knows a crazy workaround.

All Answers

RadnipRadnip
Drawloop does a similar thing too. Can you see the URL? They maybe passing the file in the URL so that it attaches to the email.
thunksalotthunksalot

Thanks for that idea, Dataville.  QuoteQuickly cut the url out of their demo video, so unfortunately, I can't see that.  

 

Do you think it could be QuoteQuickly is actually spoofing the whole Send Email form that the user is taken to when clicking their Email Quote button?  The form looks like the built-in SF Send Email form but it isn't?  Seems like it'd be a lot of work to replicate everything on that form (Select Template button, Attachments button, Check Spelling, etc).

 

From the info on their site, I don't see where DrawLoop is sending attachments via a user-editable Send Email form within Salesforce.com

thunksalotthunksalot

I think I just figured it out.  My problem is that I've been trying to get user editability while using the <messaging:htmlEmailBody> tag.  I forgot that user editability has always been available with the <messaging:plainTextEmailBody> tag, even when an attachment is appended with the <messaging:attachment> tag.  

 

The reason I've been trying to use the HTML body is because my organization is really big on branding - which requires putting our logo in everyone's email signature blocks.  Anybody know a way I could achieve that while still having a user editable email message body?  It seems impossible, but maybe somebody knows a crazy workaround.

This was selected as the best answer
Emma GroffEmma Groff
Hi thunksalot,

I am curious if you found a solution to this challenge.  We have a similar requirement, and I am searching for a way to approach it.