Jump to content

Set the default font size on the WHMCS Email editor


Charles Scully

Recommended Posts

We are trying to set the default font size on the editor. The email template editor uses TinyMCE 4 - https://www.tiny.cloud/docs-4x/ . Changing the default font size set on the TinyMCE editor may be possible using custom javascript which could potentially be added via our AdminAreaFooterOutput hook point - - https://developers.whmcs.com/hooks-reference/output/#adminareafooteroutput

 

Any suggestions?

Link to comment
Share on other sites

Hi Charles,

The following hook should work, save it as a file in your /includes/hooks/ folder:

<?php

function change_editor_font_size($vars) {

    $fontSize = '18pt';

    if ($vars['filename'] == 'configemailtemplates') {

        return '
        <script type="text/javascript">
            tinymceSettings.content_style = "body {font-size: ' . $fontSize . ';}";
            tinymce.init(tinymceSettings);
        </script>
        ';

    }

}

add_hook('AdminAreaFooterOutput', 1, 'change_editor_font_size');

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated