8

In a partner community I have a button which users click to accept a request. On the click of this button I perform an update on a record, which then causes it to meet some workflow criteria. At this point a email alert should be fired. Unfortunately the email isn't received and I see the following error being thrown in the logs:

TEMPLATE_NOT_FOUND, The record couldn't be saved because it triggered an email alert that failed. Please contact salesforce.com Customer Support.

In the error it displays the template Id. The template it refers to is a Visualforce template which has previously been pushed across in a change set. This same workflow and email alert are working in a different environment. I have checked security and ensured that all the fields referenced in the template are accessible to the community user. Additionally I have checked that the data in the template is valid. If the email is triggered from the standard sf UI (e.g. I update a field, which causes the wf rule to be valid) the email alert and template work just fine. Can anyone shine a light on a solution for this?

EDIT Interestingly commenting out all the merge fields in the VF template allows the email to fire successfully.

2
  • 1
    How about the folder permissions? Is it in a folder accessible for all users? The option names ("including/excluding portal users") are slightly different in the actual UI and in the help, maybe it has something to do with that...
    – eyescream
    Jan 31, 2014 at 6:25
  • Yes that might be something to do with it. I have the folder containing the template set to accessible to all users. But the same error is still thrown. Might just have to bite the bullet and contact support.
    – Jim
    Feb 2, 2014 at 22:53

1 Answer 1

9

We found that this error was being caused, by the referenced records not being shared. We figured this out by turning all related objects referenced in the template to public read sharing, which fixed the issue. Then we back tracked through the objects and created sharing rules to share with the appropriate user.

EDIT We queried the UserRecordAccess Object to determine if our community users had access to the records referenced in the templates which helped us to narrow down the objects which weren't shared or didn't have read access for that community profile.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .