Guest site user causing TEMPLATE_NOT_FOUND error

You may get this error that email is not being sent when guest user is creating record (ex. Case creation, self registration etc.) – Error can be as “Submission Error: The record couldn’t be saved because it triggered an email alert that failed. Please contact salesforce.com Customer Support.” like https://salesforce.stackexchange.com/questions/343779/guest-user-cannot-send-vf-email-template-while-having-access-to-objects-fields

Actually, it’s security measure taken by Salesforce topProtect access to your company‚Äôs data when you send emails that use Visualforce Classic email templates to guest users. These templates can be used with Process Builder, Workflow Builder, and Apex calls.

In order to make it working for guest user, add below attribute in emailtemplate definition:

renderUsingSystemContextWithoutSharing="True"

Example: