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
Dev@Force.ax647Dev@Force.ax647 

EmailTemplate not available

I am using email template in visualforce controller to send email from site.com

It is working fine and site guest user is able to send email. But when I am logged in as customer portal user in same window and then try to send email using site guest user then I dont get any row back on following line. I enable debug log and got exception message "System.QueryException: List has no rows for assignment to SObject"

 

EmailTemplate NotifyTemplate = [Select Id,Body,Subject From EmailTemplate Where DeveloperName ='Websupportrequestautoreply'];

 

any idea why?

bouscalbouscal
Does your controller have sharing enabled?  If so, the user may not have access to the folder that the template is saved in.