• Paul Hunter
  • NEWBIE
  • 0 Points
  • Member since 2019
  • Developer
  • Latitude Geographics

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
About a week after the Spring '19 rollout, we've suddenly ran into an issue around Email Template visibilty for Customer Community Users. 

TLDR; Email Templates are not visible to Customer Community licensed Users, regardless of the access settings on the Folder under which the template resides. 

Our specific configuration is as follows - keep in mind that the custom implementations mentioned have been in place since 2015, and have not been changed in the last year if not more. 

We have a Visual Force + Tabs community that serves as a Customer Support portal

We have setup an Apex 'After Insert' Trigger on the Reply SObject to send notification emails to the original poster and those subscribed to the category/area the question was posted, of a new response to the question. 

The Trigger calls a Future Method with Callouts method on a 'With Sharing' APEX Class that compiles the needed User collection to notify, before calling an Email Helper class to send the notification emails. 

The Email Helper method which sends the notification emails does so via an Email Template (html) - the email template used is hard coded, and is within a folder accessible to the public. 

The Email Helper fails with a SOQL Exception 'List has no rows for assignment to SObject' on the following query used to retrieve the Email Template

    EmailTEmpalte template = [Select id, body, Name from EmailTemplate where Name = :templateName limit 1];    

I understand the nature of the SOQL Error, and have verified that only a single record exists that fulfills the condition. 

To further test, I wrote a Test Method which creates users of all the Profiles we have in our Org Currently, and runs a simple 'Select All' query on Email Templates to quickly see if Email Templates are visible at all to the Community User profiles. 

This test method revealed that ANY of our Customer Community licensed profiles are not able to see ANY of our email templates, regardless of the folder's access settings. Any of the Salesforce User Licensed profiles can see the template. 

After all my investigation so far, this is really starting to smell like a Platform issue, perhaps something rolled out with Spring '19 or shortly there after. 

Salesforce Support confirmed this morning that its unexpected that the templates are not visible in their current configuration.

Any help on this is greatly appreciated; thanks in advance.

--Paul

 
About a week after the Spring '19 rollout, we've suddenly ran into an issue around Email Template visibilty for Customer Community Users. 

TLDR; Email Templates are not visible to Customer Community licensed Users, regardless of the access settings on the Folder under which the template resides. 

Our specific configuration is as follows - keep in mind that the custom implementations mentioned have been in place since 2015, and have not been changed in the last year if not more. 

We have a Visual Force + Tabs community that serves as a Customer Support portal

We have setup an Apex 'After Insert' Trigger on the Reply SObject to send notification emails to the original poster and those subscribed to the category/area the question was posted, of a new response to the question. 

The Trigger calls a Future Method with Callouts method on a 'With Sharing' APEX Class that compiles the needed User collection to notify, before calling an Email Helper class to send the notification emails. 

The Email Helper method which sends the notification emails does so via an Email Template (html) - the email template used is hard coded, and is within a folder accessible to the public. 

The Email Helper fails with a SOQL Exception 'List has no rows for assignment to SObject' on the following query used to retrieve the Email Template

    EmailTEmpalte template = [Select id, body, Name from EmailTemplate where Name = :templateName limit 1];    

I understand the nature of the SOQL Error, and have verified that only a single record exists that fulfills the condition. 

To further test, I wrote a Test Method which creates users of all the Profiles we have in our Org Currently, and runs a simple 'Select All' query on Email Templates to quickly see if Email Templates are visible at all to the Community User profiles. 

This test method revealed that ANY of our Customer Community licensed profiles are not able to see ANY of our email templates, regardless of the folder's access settings. Any of the Salesforce User Licensed profiles can see the template. 

After all my investigation so far, this is really starting to smell like a Platform issue, perhaps something rolled out with Spring '19 or shortly there after. 

Salesforce Support confirmed this morning that its unexpected that the templates are not visible in their current configuration.

Any help on this is greatly appreciated; thanks in advance.

--Paul