Dear All,
I implemented a class that i added in my support setting to trigger and add selected templates in my case object.
My code seems right and I followed the step within salesforce documentation but it s nopt working. Can anyone help me on this one , i cannot find if I missed something.
global class CaseEmailTemplateSelector implements Support.EmailTemplateSelector {
// Empty constructor
global CaseEmailTemplateSelector() {}
global ID getDefaultEmailTemplateId(ID caseId) {
// Get the case record
Case c = [SELECT Origin FROM Case WHERE Id = :caseId];
String templateDeveloperName = 'QT_DE_Signature';
if (c.Origin == 'Billing DE' || c.Origin == 'Support DE' || c.Origin == 'Service DE') {
templateDeveloperName = 'Template_quick_text';
}
// Query for the email template using the developer name
EmailTemplate template = [SELECT Id FROM EmailTemplate WHERE DeveloperName = :templateDeveloperName LIMIT 1];
// Return the ID of the selected email template
return template.Id;
}