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
HollaXHollaX 

Visualforce Email Template Causing Problems

Hi All,

 

Having a strange issue at the moment.

 

We have an APEX class updating a custom object, but it is failing with this error message:

 

INSUFFICIENT_ACCESS_OR_READONLY, user does not have access to use approval assignment email template: []

 

When the object is updated, a workflow email is sent as confirmation to the user. This is not a part of any approval process. In fact this object is not used in any approval process whatsoever.

 

We have already done plenty of experimenting and have discovered that if this workflow email is a VisualForce template containing any relatedto.FIELD , it fails with the above message. If it is any other email template type it works fine. 

 

We tried a basic VisualForce template as below, which doesn't cause the error:

 

<messaging:emailTemplate subject="test" recipientType="User" relatedToType="customobject__c">
<messaging:HtmlEmailBody >
test
</messaging:HtmlEmailBody>
</messaging:emailTemplate>

 

 

We then tried a VisualForce template with a field that works without error in the text based email..... but still it causes the above error in the visualforce template

 

<messaging:emailTemplate subject="test" recipientType="User" relatedToType="customobject__c">
<messaging:HtmlEmailBody >
test -  {!RelatedTo.Field__c}
</messaging:HtmlEmailBody>
</messaging:emailTemplate>

 

So there must be a problem with accessing the RelatedTo fields, I guess?

 

But why do the text based emails work?

 

 

 

 

 

 

HollaXHollaX

Updated the description of the issue, as I mis-wrote the last part of it :)

SoozeeSoozee

Having the same exact issue.

Camila Heitz 4Camila Heitz 4
I am having the same trouble. Any solutions?
Michael LlMichael Ll
I had this same error:
INSUFFICIENT_ACCESS_OR_READONLY, user does not have access to use approval assignment email template: []

A email template had a visualforce component and the user profile didnt have permission to the apex controller for that component. gave them permissions and it worked.
GuiSGuiS
Michael's answer just saved me. Thank you!
Richard Brescia 8Richard Brescia 8
I am having the same trouble, and the VF email template is stand alone with no other VF component involved.  I am failing to see how to provide access to this template as only Admins apparently do so.  It's not available as a VF page to grant access and there is no VF component to grant access to.  What is the solution here?
Jayanth G 3Jayanth G 3

Hey Richard,

 

Even I have the same problem as yours but I am also not able to find the solution. If you have found any, please let me know at jayanth.g@crmit.com.

Thank you