Click & Pledge's "Click & Pay" Salesforce app makes use of a feature called 'Salesforce Sites' so that your organization does not have additional costs to send custom emails and publish events online.
This requires custom configuration of the Sites feature, so when you experience an error with your event page or sending emails with images or attachments, you may find it helpful to review your Salesforce Site permissions. C&P has provided this custom configuration by providing gratis installation and post-installation; however, Salesforce is drastically modifying this feature of their platform to implement Salesforce Communities.
This article identifies the errors that require modifications to Salesforce Sites and reviews the latest version of these settings.
- Errors that may require Site setting review
- Site Domain
- Site Detail
- Site Profile
- Site Guest User
- Sharing Settings
Errors that may require Site setting review
- "Authorization Required" Error
- "Event not found" error
- CnP_PaaS_EVT__Event__c object doesn't have the view permissions
- These fields (CnP_PaaS_EVT__C_P_API_Setting__c, CnP_PaaS__Currency code....(etc) doesn't have permissions to view by the User
- CnP_PaaS_EVT_Event_Settings__c object doesn't have the view permissions.
- PS-CnP-Event-ONLY-SiteGuestUser
- PS-CnP-PaaS-ONLY-SiteGuestUser
Site Domain
As part of initial post-installation, you must create a Site Domain. Note that the Site Domain in Salesforce is different from setting up "My Domain" "My Domain" affects the URL you use to work within Salesforce, Site Domain affects the URL used to create public sites or Communities - now referred to as "Digital Experiences".
The site is used to host images that you include in Autoresponders and Invoices , and hosts the form you create to sell tickets in Event Management.
By using this feature of Salesforce, your organization does not have to purchase an SSL or provide hosting to have an Event page.
- In Salesforce, click the Setup gear icon at the top right
- Type 'Site' in the Quick Find box of the left column. DO NOT hit enter.
- Click on 'Sites'
- On the Sites page, you can choose a domain name for your Salesforce Site. We recommend entering the same text as your domain for your primary website.
e.g. 'ClickandPledge' (from our site, 'https://clickandpledge.com/')
- Once you have chosen a domain, and checked the Terms of Use, click 'Register My Salesforce Site domain'
Once complete, you must still request post-installation by granting login access , collecting your Organization's Id , and by requesting post-installation in the forum or by creating a Support ticket. You may go ahead at this point and Re-verify your Connection
Site Detail
Navigation
- Go to "Setup" (gear icon)
- Type "Site" in the Quick Find, DO NOT HIT ENTER
- Click Sites
- Click the Site Label for the site used for Click & Pledge apps.
Site Detail values needed
- Site Contact - user that will receive notifications relevant to the Site
- Default Web Address - The subfolder of the URL that will specifically reference this Salesforce Site.
- Active - must be checked for the site to function
- Active Site Home Page - set to CnP_PaaS_EVT.ActiveEventPage
- Clickjack Protection Level - If event pages will be embedded into other websites with iframes (likely), set to "Allow framing by any page", otherwise "Allow framing by same origin only" is sufficient.
- Referral URL - needs to be unchecked. Causes "Event is not found" error if checked.
- Default Record Owner - be sure to set one. Used to create the records in the Event objects.
Site Profile
To access the Site Guest User Profile, click the "Public Access Settings" button on the Site Detail screen
The Site User Profile screen will vary, depending on whether the Enhanced Profile User Interface is selected in your instance's User Management Settings
Salesforce Reference: User Management Settings
With Enhanced Profile User Interface disabled, the Site User profile page will be incredibly long. You are looking to verify the Standard Object Permissions. The Find function (Ctrl-F) of your browser can be helpful will these long screens
If Enhanced Profile User Interface is enabled, you will need to navigate to each object individually to review its settings. Add permissions as indicated in the screenshot without Enhanced Profile Interface enabled.
- Click on Object Settings
- Click on the Object to review or edit
- Review the Object Permissions for Account, Campaigns, Contacts, Documents, Leads, Opportunities, and Products.
- Review the Field permissions, if needed. Best practice is to check Read permission for each field.
- Move to the next object for review.
Site Guest User
Return to Profile Overview screen above, click "Assigned Users" to see the Site Guest User
Time Zone
The Site Guest User's time zone informs the time zone used for the times on the Event registration page. If your organization sets up events in multiple time zones, best practice is to create a separate Site for each time zone.
Edit the Site Guest User to the time zone needed for Event Management.
Permission Sets
As of the Spring '21 release of Salesforce, Site Guest User permission sets are replaced by sharing rules, and are no longer necessary. If your Salesforce instance is Spring '21 or later, and you do not experience errors loading C&P Event registration pages, you may safely remove these permission sets from the Site Guest User:
- PS-CnP-Event-ONLY-SiteGuestUser-CRU
- PS-CnP-PaaS-ONLY-SiteGuestUser-CRU
Sharing Settings
As of the Salesforce Winter '21 release, the Site Guest User uses "sharing" to access custom objects, rather than opening up this security through permission sets.
Enable External Sharing Model
Navigate to Sharing Settings
- Click the gear icon at the top right, select Setup
- Type "sharing" in the Quick Find
- Click "Sharing Settings"
- Click the "Enable External Sharing Model" button. If there is a "Default External Access" column, external sharing is already enabled.
Change Default External Access for C&P Objects to "Private"
On the Sharing Settings screen, click "edit", and change Default External Access to "Private" for ALL the objects that start with "C&P" (there's quite a few, not all are shown here)
Create the sharing rules
- In Click & Pay Suite go to Settings > Maintenance. The Site Guest User Permissions tab opens.
- Move the desired sites to the righthand side box.
- Click "Assign permission to the guest user"
In Sharing Settings, they look like this:
There's nearly 60 of them! They are created by an Apex job, so best practice is to monitor the job to make sure it completes.
To monitor the sharing rule job:
- In Salesforce Setup, type "job" in the Quick Find (left column)
- Click "Apex Jobs"
- Find the job labelled "CnP_GuestUserPublicAccessQueueable"
- Verify the job status is "Completed". Refresh your browser tab every few minutes to update the Status
Recalculate the sharing rules
- Return to Setup > Sharing Settings
- Click the Manage sharing settings for: dropdown, and choose "Opportunities"
- Scroll to Opportunity Sharing Rules, verify the rule exists for the Site Guest User, and click "Recalculate"
- Repeat steps 1-3 for Leads and Campaigns.