• Ehsan Yazdjerdi
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

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;
	
	}

}