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
Chris Larson 14Chris Larson 14 

Visualforce email template not working in flow

I've got a classic email template that's run as an email alert from a flow that iterates records and sends email to a related contact. Works great.

I want to change the classic email tamplated to a VisualForce email template so that I can have better formatting and conditional content.. I created the Visual email template, which runs fine from the template builder.  

I switched the email alert to the new template, tested the flow, and received the following error message:

HED__COURSE_ENROLLMENT__C.CONNECTION_WAIVER_EMAIL (EMAIL ALERTS): Send Waiver Email
Inputs:
SObjectRowId = {!Iterate_Course_Connections.Id} (a0V8C0000006Bm9UAE)


Error Occurred: We were unable to process the email template. Error Message: core.email.template.TemplateRenderingException: Read access denied for hed__Course_Enrollment__c, controller action methods may not execute.

Thoughts on what's going wrong?  Thanks!
 

Maharajan CMaharajan C
Have you given the read access to the  HED__COURSE_ENROLLMENT__C object for that particular user profile who is kicking this email alert?

Do you have any custom controller on that VF temaplate... Is it running in system mode or user mode... If user mode then change it to system mode (remove the with sharing keyword)...because workflow will run in system mode...

Thanks,
Maharajan.C
Olivia Bennett 4Olivia Bennett 4
I believe your target is contact. If you want to use the Visualforce Tamplates in workflow you need crate both recipients and related to with Cntact object. Should look like below.
https://www.mymerrill.me/
 
jason hobsejason hobse
Clapgeek.com team uses professional knowledge and experience to provide VMware Certified Specialist - vSphere with Tanzu 2022 5V0-23.20 Questions and Answers for people https://www.clapgeek.com/5V0-23-20-exam.html ready to participate in VMware vSphere with Tanzu Specialist exam. The accuracy rate of 5V0-23.20  exam questions provided by Clapgeek are very high and they can 100% guarantee you pass the VMware 5V0-23.20  exam successfully in the first attempt. Everyone can get 5V0-23.20  pdf with free test engine to study. Clapgeek can promise you always have the latest version for your VMware 5V0-23.20  test preparation and get your VMware Certified Specialist - vSphere with Tanzu 2022 certification easily.