I'm developing a CMS system where you can edit the mailtemplates for certain e-mails that are sent and I'm looking for a plugin that enables me to insert custom tags into the editor (not html tags but on the format [whatever]). Note that the content of the mailtemplate should be html it's just certain tags that I would like to have on that format.
For example I would like a button in the toolbar where the user clicks and is presented with a list of available tags, it could be something like FirstName, LastName, Email etc.
When a user selects FirstName and clicks "ok" the source that is generated should look like [FirstName]. It would be desirable if the tag itself was clickable when it was inserted and clicking it would bring up the "Custom tag"-plugin.
It would also be nice if one is in edit mode in ckeditor and a tag is inserted, that the brackets would be removed, thus only shown in the source. Perhaps the tag could be displayed with a background-color to indicate that it is infact a "Custom tag".
Has anyone created a similiar plugin or know of such a plugin? If I were to write my own, any good tips on a plug-in that I could base my plugin on?