+ Start a Discussion
acrozieracrozier 

emailing a page reference as PDF attachment

Hello,

 

I would like to send an email alert based on a workflow rule on a custom object.  when the condition is met I want an email to go out with a visualforce page as a pdf.  how can I do this?

kkr.devkkr.dev

Have the workflow rule perform a field update instead of an email alert. The field update will trigger your trigger, and you send the email from there (i.e. if (record.triggered__c ) { ... } ).

Unfortunately, there is a messaging:attachment tag in Visualforce templates, but it doesn't support adding actual files-- you can only render a new attachment (i.e. a list of cases in PDF format).

Given what you're trying to do, I'd recommend a field update with a trigger. That should get you where you want to go.