Can we add "Add email" option to RTE editor toolbar? | Community
Skip to main content
ChrisPhillipsUC
Level 2
March 9, 2026
Question

Can we add "Add email" option to RTE editor toolbar?

  • March 9, 2026
  • 1 reply
  • 6 views

Going back to basics here but is there a way to add an “Email” icon to the RTE toolbar so authors can simply copy and paste an email address into the field without having to worry about adding in “mailto:” prefix?

We have a lot of authors who forget this prefix which then turns the link into http://email@somewhere.com causing it to break and show up on our scans as 404/broken link.

Seems odd that Adobe would omit this from the UI or any option to configure this to the RTE if needed.

Regards

Chris.

 

1 reply

AmitVishwakarma
Community Advisor
Community Advisor
March 9, 2026

Hi ​@ChrisPhillipsUC 

Out of the box AEM does not provide a dedicated "Email" / mailto: button in the RTE.

You can, however, add one reliably with a small custom plugin and config:

1. Allow mailto: links in the RTE

For your Text component, make sure mailto: is allowed under htmlRules:

/apps/your-site/components/content/text/dialog/items/tab1/items/text
- xtype = "richtext"
+ htmlRules
+ links
- protocols (String[]) = ["http://", "https://", "mailto:"]
- defaultProtocol = "http://"

2. Simple custom RTE plugin for "Email"

Create a clientlib, e.g. /apps/your-site/clientlibs/rte-mailto with category cq.authoring.dialog and a JS file:

;(function () {
"use strict";

var RTE = CQ.form.rte;
var FEATURE = "mailtolink";

var MailToPlugin = new Class({

extend: RTE.plugins.Plugin,

getFeatures: function () {
return [FEATURE];
},

initializeUI: function (tbGenerator) {
if (!this.isFeatureEnabled(FEATURE)) {
return;
}

var button = tbGenerator.createElement(FEATURE, this, false, {
title: "Insert email link",
text: "Email"
});

tbGenerator.addElement("links", FEATURE, button, 10);
},

execute: function (id, value, env) {
var ek = this.editorKernel;
var sel = RTE.Selection.getText(env.editContext) || "";
var email = sel.trim();

if (!email || email.indexOf("@") === -1) {
return;
}

if (!/^mailto:/i.test(email)) {
email = "mailto:" + email;
}

ek.execCmd("createlink", email);
}
});

RTE.plugins.PluginRegistry.register(FEATURE, MailToPlugin);
}());

Usage for authors: Select user@domain.com -> click Email -> it becomes <a href="mailto:user@domain.com">user@domain.com</a>.

3. Enable plugin + toolbar button

Under your component's RTE config (in-place + dialog):

.../rtePlugins
+ mailtolink
- features (String[]) = ["mailtolink"]

And in uiSettings toolbar items:

.../uiSettings/cui/toolbars/fullscreen
- items (String[]) = [
"links#modifylink",
"links#mailtolink", // new email button
"links#unlink"
]

After this, authors no longer need to remember mailto:; the plugin wraps the selected email correctly, avoiding http://email@… and broken-link scans.

Amit Vishwakarma - Adobe Commerce Champion 2025 | 16x Adobe certified | 4x Adobe SME