I'm currently having troubles to make a custom email sender page for the Case tab. I needed to automatically fill some fields depending on some parameters from the case.
It almost works, but when I load an email template which contains an image, the text area disappears and the console shows:
ReferenceError: CKEDITOR is not defined
I tried several ways to fix it but nothing helped.
Here is the VisualForce page used:
<apex:page standardcontroller="Case" extensions="Ctrl_ActionsCase" action="{!sendEmailInitFrom}">
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript">
var j$ = jQuery.noConflict();
// Page Init
j$(document).ready(function() {
// Set FROM addresse
var optionFromAdresse = j$("select[id*=from] option[value*='{!addressEmailFrom}']");
if(optionFromAdresse.length > 0) {
optionFromAdresse[0].selected = true;
}
});
</script>
<apex:emailPublisher id="emailPublisher"
entityId="{!case.id}"
width="500px"
title="{!$Label.Email_Action_Title}"
expandableHeader="false"
autoCollapseBody="false"
showAdditionalFields="false"
showTemplates="true"
fromVisibility="selectable"
toAddresses="{!case.contact.email}"
toVisibility="readOnly"
bccVisibility="hidden"
ccVisibility="hidden"
emailBody=""
emailBodyHeight="4em"
subject=""
showSendButton="true"
sendButtonName="{!$Label.Send_Email_Button}"
/>
Regards.