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
Zachary Bergeron 7Zachary Bergeron 7 

Guest site user causing TEMPLATE_NOT_FOUND error

I'm encountering an issue with a guest site user receiving this error: " Insert failed. First exception on row 0; first error: TEMPLATE_NOT_FOUND, The record couldn't be saved because it triggered an email alert that failed. Please contact salesforce.com Customer Support". I've narrowed down the issue to merge fields on an email template causing the problem. Seems the guest site user somehow doesn't have access to the records being used as merge fields. The sharing settings for these objects are set to "Public Read/Write" access. I also tried adding a "Guest user access, based on criteria" sharing rule granting access to all records based on criteria that would hold true for any record. ANy idea how I may be able to fix this issue?
SwethaSwetha (Salesforce Developers) 
HI Zachary,
I believe you are seeing this issue post Spring'21 release.

This is expected behavior as of Spring '21 release for Guest Users. The following guest user object permissions are removed with the Spring ’21 release

Edit
Delete
Modify All
View All

I can recommend two things:
>Review your object access/operations for the current Guest User.
>Insert ops are still possible so you can try a staging object with the Site data and then map it to the SObject that is blocked today from being updated. Mapping from staging to SObject would take place under a full license user / system admin.

Related:https://salesforce.stackexchange.com/questions/334913/exception-thrownexternalsystem-visualforceexception-update-access-denied-fo#comment494310_334913
https://salesforce.stackexchange.com/questions/291587/troubleshooting-site-guest-user-access-after-enabling-secure-guest-user-record

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
hims mosehims mose
Try to find it in your business or web directory. I have faced the same issue in my website of deadlift shoes reviews (https://bestdeadliftshoes.com/best-deadlift-shoes/).
Kamal Arora 9Kamal Arora 9
Hi Zachary,

This is because the Site Guest user doesn't have access to the template. The template needs to be updated and the first line of the templated needs to include the tag: renderUsingSystemContextWithoutSharing="true"
<messaging:emailTemplate subject="test" recipientType="Contact" relatedToType="Case" renderUsingSystemContextWithoutSharing="true">

Please mark this as best answer if your issue gets resolved.