1

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.

1

You need to add script tag on your page using CDN:

<script src="//cdn.ckeditor.com/4.5.3/standard/ckeditor.js"></script> 

or download ckeditor package and embed local script:

<script src="../ckeditor.js"></script>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.