+ Start a Discussion

insert into template an attachment stored in opportunity

I need to create a template for use into opportunity which get attachment stored into the opportunity into note&attachments.
I'm able to do this with a trigger but I'm not able to create a template.
My goal is to send an email and the receiver will be able to open pdf.
I try this code but I have a pdf with this text : "core.filemanager.ByteBlobValue@22ad1468" 

<messaging:emailTemplate subject="test email" recipientType="Contact" relatedToType="Attachment">
<messaging:plainTextEmailBody >
test new template xxxx
<messaging:attachment renderAs="pdf" filename="filename.pdf">

I found some topic for convert "body" into a blobvalue or similar but I didn't solve the problem

Please refer following document and threads referring similar issue:

the 3 links that you have posted don't show me what I want.
they explaine how create a template with the link to the pdf, and so the receiver of my email need to login on salesforce for see the pdf, instead I need that who receive my email don't need login on salesforce and can see the pdf as attachment of email

Divya SDivya S
Hi Mattone84,  

Have you got the solution for you issue, I am running into the same issue and have been struggling with it for the past 2 days.  I would appreciate your response. Thanks !
sorry but I solve with a trigger
hi mat_tone are you availble , i have a query .. 
thanks and regards