I have the following visualforce email template.

<messaging:emailTemplate subject="Unpaid Invoice" recipientType="Contact" relatedToType="Invoice__c">
<messaging:htmlEmailBody >

        <p>Dear {!recipient.Name}</p>
        <p>This is the first email reminder about your unpaid invoice.</p>
        <p>Please find the attached file</p>


<messaging:attachment renderAs="PDF" filename="{!relatedTo.name}">


I have a custom object 'invoice' that store pdf file in the related list. It also has a lookup relationship with the contact. I have a process that sends the email 1 hour after the invoice is created. I receive the email with attachment but the problem is the attached file is white blank. It has not attached the file from the related list of the invoice object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.