---
schema_version: "1"
id: 9bdf39f292cd818d9ed53fd3e9a09e6da2bd08f83ea714320d37708520a5c424
title: Use Visualforce Email Templates with Guest Users
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/email_templates_vf_guest_users.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.email_templates_vf_guest_users.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 6c470cc0e00d3dd50b6fc4dc318f5afac3537a52de487588f4cc9b3b46c011ef
description: Protect 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.
products:
  - Sales Cloud
  - Cross Cloud
  - Service Cloud Voice
release: "264"
---
# Use Visualforce Email Templates with Guest Users

Protect 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.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Essentials</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

In Spring ‘20, Salesforce introduced a security policy that affects Visualforce email templates that are used for emails sent to guest users in Experience Cloud sites.

Emails that use Visualforce email templates send information based on a user’s access to Salesforce data. But because data access for guest users is limited in Salesforce, the templates don’t work after you apply the security change.

Data access is divided into two main categories, or contexts.

- System Context—A user’s permissions are ignored, and the request executes irrespective of permissions. These permissions can include the keywords with sharing, without sharing, and inherited sharing.
    
    If a Visualforce email template is requested from a feature running in system context without sharing, the email is rendered in system context.
- User Context—All the user’s permissions and access settings are followed.
    
    If a Visualforce email template is sent from any other context, the email is rendered in user context.

For more information on context, see the Apex Developer Guide.

To ensure that a Visualforce email template runs in system context and is visible to guest users, add the `renderUsingSystemContextWithoutSharing="True"` attribute to the `emailTemplate` tag. Setting `renderUsingSystemContextWithoutSharing="True"` doesn’t override existing security settings for email object visibility. For example, to let a partner site member see User objects from a customer site, add the partner site member to the customer site and set `renderUsingSystemContextWithoutSharing="True"`.

![Warning](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_productivity-264-0-0-production-enus/b2f6c36a-fa61-4a3c-9752-032ce1818a69/images/icon_warning.png)

Warning When `renderUsingSystemContextWithoutSharing="True"`, the email template runs in system mode, which bypasses user permissions, field-level security, and organization-wide defaults. Be careful when using this setting so that you don't inadvertently expose sensitive data. Before using this setting, assess the impact of the guest security policy and, if necessary, update the Visualforce email templates instead.

If the security policy changed a guest user’s access to email templates, update the template's context wherever a guest user can generate an email.

- When using Apex’s Messaging Class, ensure that your Apex class has the without sharing keyword in the definition. This keyword is required when you’re sending an email directly or from an Apex trigger.
- When using a Flow, ensure that you invoke it from an Apex Class that has the without sharing keyword, or from Process Builder.

No updates are needed if one of these features is used to trigger an email for a guest user:

- Process Builder
- Workflows

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_productivity-264-0-0-production-enus/b2f6c36a-fa61-4a3c-9752-032ce1818a69/images/icon_note.png)

Note Classic Visualforce email templates must be edited in Salesforce Classic, but they can be used in Lightning Experience with Process Builder, Workflow Builder, and Apex calls.

#### See Also

- [Modify a Visualforce Email Template for Guest Users](https://help.salesforce.com/s/articleView?id=sales.email_templates_vf_modify_for_guest.htm&release=264.0.0&type=5 "Protect 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.")