You need to sign in to do that
Don't have an account?
How do I use Support.EmailTemplateSelector?
Hi All - so we're looking at possibly rolling out a custom email publisher for use on the CaseFeed that would leverage the <apex:emailPublisher> functionality.
In conjunction with that, I'm trying to create an Apex class to use for Email Template selection and enable it for the Enable default email templates feature located in Support Settings. I've referenced the documentation and nearly copied the example code provided here: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_email_template_selector_example.htm but I'm receiving the following error in Eclipse for my code: Save error: Invalid type: Support.EmailTemplateSelector
Here's my code - what am I missing?
global class CaseEmailTemplateSelector implements Support.EmailTemplateSelector { // Empty constructor global CaseEmailTemplateSelector() { } global ID getDefaultEmailTemplateId(ID caseId) { // Get the current Case Case c = [SELECT Id, Subject FROM Case WHERE Id = :c.Id]; EmailTemplate et; // For Support Record Type, use the Support Case Response email template if(c.RecordTypeId == System.Label.Case_Support_Record_Type_ID) { et = [SELECT Id FROM EmailTemplate WHERE DeveloperName = 'Support_Rep_Case_Response_Shell_HTML']; } return et.id; } }
Hi there,
Thanks for the feedback - I actually discovered that we had a class titled "support" which was interfering with the ability to call Support.EmailTemplateSelector so the class is now saving properly.
Unfortunately, I'm not seeing it work in my environment. When opening up the standard or custom Email Publisher, the email template is not being loaded. Anyone have any thoughts as to what I should double check?
All Answers
Hi,
By looking at error log, looks like your eclipse is not updated since long for API version. Could you please try to save the same in salesforce through UI.
Hi there,
Thanks for the feedback - I actually discovered that we had a class titled "support" which was interfering with the ability to call Support.EmailTemplateSelector so the class is now saving properly.
Unfortunately, I'm not seeing it work in my environment. When opening up the standard or custom Email Publisher, the email template is not being loaded. Anyone have any thoughts as to what I should double check?
If anybody needs any assistance, I was able to succesfully implement the Default Template Switcher (per this blog post (https://www.salesforce.com/blog/2012/10/case-feeds-smart-template-sample-implementation.html)), and willing to assist.
A quick note though - it seems that the Template is only set once, and doesn't populate when re-composing an email in the Publisher / selecting to 'Reply' or 'ReplyAll'. I am still trying to figure out how to workaround this.
Thank you,
Ido.