+ Start a Discussion
ruehawkruehawk 

Dynamic sending Email in APEX - failing after Winter 14

We have custom settings and an APEX class that is returning zero records after October 12th.

The day that Winter 14 was implemented in our production environment.
 Up to that day we would average about 10 emails a day from this approval process.

 

The select statement that returns zero is 
EmailTemplate template = [ 
select id 
from EmailTemplate 
where developerName = :System.Label.PRW_Phase_Assigned_Accounting_Notification_Email_Template_Name 
]; 

This is embedded as part of an Approval process. When I, as an administrator, approve  this select statement will return the template name.   Everything is fine.

However, when our production staff approves then this will return no rows. 

I can not figure out where to check their profile to the emailtemplate object. Or is there another way of granting permission for these templates?  I don't see an object as part of App Setup - Customize...

Rudy

 

Best Answer chosen by Admin (Salesforce Developers) 
ruehawkruehawk

Thanks for the reply Auyon.

 

I found that Email Template Folder under the Communication Templates of Admininstration Setup was checked as "This folder is hidden from all users".

I changed it to "This folder is accessible by all users" and tested the change in Test.  It worked.

 

The Winter release must have changed the setting, because this has been working for 2 years.

 

Once I get confirmation that this particular email templete is working I'll reply back.

 

Thanks again.

 

Rudy

 

 

All Answers

AuyonAuyon

Rudy,

 

It would hard to deduce any conclusions or directions with only the query here. The query does not have any dependency on when it is called, so its difficult to pin it on a security/permission issue or a implementation issue.

 

Can you post the part of the debug log? and the entire method where the code resides? 

 

Our org went to Winter 14 on 12th Oct as well but I don't think there were any email issues reported. But when our Sandboxes were upgraded due to some odd reason some of the emails just stopped going out. The log would show that the email was added to the email queue but they never went out. It was a Salesforce issue, I think they fixed that.

 

Looking forward for some more info.

 

ruehawkruehawk

Thanks for the reply Auyon.

 

I found that Email Template Folder under the Communication Templates of Admininstration Setup was checked as "This folder is hidden from all users".

I changed it to "This folder is accessible by all users" and tested the change in Test.  It worked.

 

The Winter release must have changed the setting, because this has been working for 2 years.

 

Once I get confirmation that this particular email templete is working I'll reply back.

 

Thanks again.

 

Rudy

 

 

This was selected as the best answer