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

emailing a page reference as PDF attachment



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?

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.