You need to sign in to do that
Don't have an account?
Visualforce email template attachment not working when setting template in URL
I have created a Visualforce email template that automatically attaches a PDF rendering of a quote from the opportunity object. It works fine when manually selecting the template from the email author page.
However, if I create a custom button on the opportunity page to take me to the email author page with the whoid, whatid, and template id defined in the URL, the email subject and body show up just fine but there is no attachment. Anyone else run into this? Any ideas on a fix?
Message Edited by trsmith on 11-17-2008 01:08 PM
Message Edited by trsmith on 11-17-2008 01:10 PM
However, if I create a custom button on the opportunity page to take me to the email author page with the whoid, whatid, and template id defined in the URL, the email subject and body show up just fine but there is no attachment. Anyone else run into this? Any ideas on a fix?
Message Edited by trsmith on 11-17-2008 01:08 PM
Message Edited by trsmith on 11-17-2008 01:10 PM
I had the same problem today.
I found a post that suggested adding "&new_template=1" to the URL.
No idea why it worked, but it worked. The attachment is no longer missing.
All Answers
Yes,
Having almost this exact problem... did you solve it?
I have this exact same problem--I went and looked into seeing if I could maybe copy the javascript behind the templateselector.jsp when you hit the "select template" button on emails and then put it into an s-control button--
I was trying to figure out where the difference was between selecting the template that way and selecting it via the URL line...but I couldn't really figure it out...
Hopefully somebody will come up with some sort of solution soon
I had the same problem today.
I found a post that suggested adding "&new_template=1" to the URL.
No idea why it worked, but it worked. The attachment is no longer missing.
Hi:
I'm trying to do the exact same thing but I'm using a professional edition. I'm able to use visualforce but do not have access to APEX code. Do you know if it is possible to achieve the automatic pdf attachment without using APEX. Or is there a standardController that I can use?
I'm not sure how limited the Professional Edition is as far as what you can and can't use. I know you said you can't use APEX code, but does that just mean you can't create APEX classes and triggers? Do you have the ability to create visualforce email templates in Professional Edition? If so, then you should be able to use something like the following and use HTML. It just depends if you're able to create visualforce email templates.
<messaging:emailTemplate subject="Here is your proposal!" recipientType="Contact" relatedToType="Opportunity">
<messaging:htmlEmailBody >
<!--EMAIL BODY (can be HTML)-->
</messaging:htmlEmailBody><!---END EMAIL BODY-->
<messaging:attachment renderAs="pdf" filename="Quote">
<!---------------------------------PDF Body (Can be HTML)--------------------------------------->
</messaging:attachment>
</messaging:emailTemplate>
Hi,
My opportunity has some files attach to it under "Notes and Attachment" section.
Do you know how I can include these files in the email as attachments.
Any info will be appreciated.
Thanks
I apologize in advance because this is going to be broad...but maybe you could write a class that does a query to pull all the attachments/notes related to the record you're sending the email from and then have your APEX code call that class...and render them into a pdf attachment on the email...?
I know it's not specific...just brainstorming.
how would you approach to doing this?? Any examples that you can show??
Thanks!
window.open("/_ui/core/email/author/EmailAuthor?retURL=/{!Lead.Id}&p2_lkid={!Lead.Id}&rtype=00Q&p26=xxx@gmail.com&template_id=0034543000b4Dx&new_template=1","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, width=800, height=650");