How Can I Customize Buttons That Display in the Email Editor?
You must be a Sugar administrator.
With the release of Sugar 5.5, the Emails module was significantly enhanced to make it simple and easy to use. As part of this effort, the page where you compose the email was also simplified. As a result, the number of available buttons in the HTML editor has been reduced to only those commonly used. However, it is possible to override and customize the buttons that are displayed within the TinyMCE editor throughout the application.
Although the customization cannot be performed within the application itself, the process is still very straightforward. The following steps outline what is needed to customize the button toolbar presented within TinyMCE:
1. Create the following configuration file: custom/include/tinyButtonConfig.php . The path to the file assumes that you are starting in your SugarCRM webroot location.
2. Create and modify an array entry similar to the following within the file created in step 1:
$buttonConfigs = array(
’email_compose’ => array(
‘buttonConfig’ => “bold”,
‘buttonConfig2’ => “italic”,
‘buttonConfig3′ => “”,
’email_compose_light’ => array(
‘buttonConfig’ => “code,help,separator,bold,italic,underline”,
‘buttonConfig2’ => “”,
‘buttonConfig3’ => “”,
3. The keys defined at the top level of the array refer to a configuration entry for different parts of the Sugar application that display the TinyMCE editor. To date, there are three valid types:
- email_compose: Displayed within the compose screen present within the Email module.
- email_compose_light: Displayed within the compose screen that is visible in the Quick Compose screen. This screen is accessible from anywhere within the application when a user clicks on an email address.
- default: Used throughout the rest of the application, for example, in email templates, KB articles, and so on.
5. Within each “buttonConfig” entry, you can specify which buttons should be displayed. If you wish to make a particular button toolbar empty you can specify the empty string “”.
For a list of available buttons, visit the TinyMCE wiki. The changes will become visible as soon as the file has been saved and the particular screen refreshed. No additional repair scripts need to be run. Congratulations, you have just customized your TinyMCE editor!