+ 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?