You need to sign in to do that
Don't have an account?
kladizkov
On-the-fly attachments in workflow email alert
Hi
I'm trying to develop a workflow rule, that can send email alert. But I need to attach a file from "Notes and attachments" section of an object to the email. This attachment will be different for each email I send. So, storing it in email template won't work.
Is there anyway to add an attachment on the fly? Please help.
According to my research, you can do the following:
- 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.
All Answers
You might be able to use a trigger to change the template as triggers fire before workflow rules.
I'm pretty sure you can't edit the workflow rules themselves though as SFDC doesn't allow production to leverage the metadata API to create workflow rules as it could be problematic.
Hi,
From what I understand about triggers, its not possible to use it on a workflow rule. My workflow rule has a time dependent workflow action which sends an email alert after x days. What I need to do is attach a file from "notes and attachment" section to the email alert that I send. Is this possible in salesforce?
I'm not suggesting you use the trigger to modify the workflow rule as that isn't possible from production.
According to my research, you can do the following:
- 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.