Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature to insert html snippets within Composer #142

Closed
RealRaven2000 opened this issue Aug 10, 2021 · 8 comments
Closed

Add feature to insert html snippets within Composer #142

RealRaven2000 opened this issue Aug 10, 2021 · 8 comments

Comments

@RealRaven2000
Copy link
Owner

To add rich + useful content SmartTemplates should offer a menu to insert external html templates so we can insert paragraphs or buttons. One interesting use case I experience daily is the need to insert a simulacrum of the New Issue button for directing my users to the github issue tracker. Currently I achieve this by going to Insert / Html... and entering the following code:

New Issue

I am including the necessary layout rules to make it look correctly within an external CSS file which I include into my support templates, but it is still significant effort to type out the html above. If we could have a button (just like the change template button) on the composer toolbar that gives a one click selection to insert the html from an external file.

This should have a tree / menu hierarchy so that different snippets can be categorized rather than having a long list to choose from.

@RealRaven2000
Copy link
Owner Author

See also issue #28 (this is a duplicate and I never had the time to implement it. Good ideas over there!

@RealRaven2000
Copy link
Owner Author

First Prototype. The hard thing is getting at message headers as for some reason, gMsgCompose.originalMsgURI is not set for replied / forwarded mails anymore! We need to find out how else we can get at the headers, I guess we need to use the API instead. Which means rewriting all processing as an API / background method.

smartTemplate-fx-3.8pre49.zip

to add snippets:

  • add the new [insert Snippets] button to the composer toolbar
  • Click configure menu item...
    image
  • Activate the Smart Snippets tab
    image
  • add HTML files to it
  • to insert a HTML snippet, select it from the [insert Snippets] button in composer

@RealRaven2000
Copy link
Owner Author

Added the implementation for the ad-hoc command to "Open SmartTemplates template file..." directly and insert it:

smartTemplate-fx-3.8pre55.zip

As usual - to install, download the zip file and drag it into Thunderbird Add-ons Manager.

@RealRaven2000
Copy link
Owner Author

RealRaven2000 commented Sep 20, 2021

Added localization. This works now very similarly to the other templates (except it's on its own tab "Smart Snippets").

To do:

  • automatically select the Smart Snippets tab when the "configure menu items" menu item is clicked.
  • create an icon for the button and the tab in settings
  • create a placeholder variable for %selected% text so it can be incorporated into the snippet (e.g. if you want to create a button from a label). At the moment, you can use %cursor% and paste or type the contents after insertion of the fragment.

smartTemplate-fx-3.8pre58.zip

To install, download the zip file and drag it into Thunderbird Add-ons Manager.

@RealRaven2000
Copy link
Owner Author

  • Added Icons.
  • Fixed the style to use the more compatible attribute is="toolbarbutton-menu-button" to make it look like the other dropdown buttons. A also rewrote the algorithm in charge of accelerators so that folders (categories) get their own alphabetic accelerator and the templates in submenus start counting at 1.
    image
  • Automatically select the "Smart Snippets" tab when "configure menu items..." is selected from the Snippets button:
    image

smartTemplate-fx-3.8pre86.zip

To install, download the zip file and drag it into Thunderbird Add-ons Manager.

@RealRaven2000
Copy link
Owner Author

  • Fixed a bug when opening a Snippet file directly in Composer
  • Localized (Thunderbird 78 version only)
  • ported to Thunderbird 68
  • Added description to what's new screen (Tb78)

Tb68 version: smartTemplate-fx-2.17pre29.zip
Tb78-91: smartTemplate-fx-3.8pre108.zip

@RealRaven2000
Copy link
Owner Author

RealRaven2000 commented Sep 26, 2021

Latest versions for legacy (68) and current Thunderbird versions (78 and 91.*).

  • fixed some layout problems with the snippet icon in composer (tb68)
  • added update of snippets menu items in composer after configuring new menu items (Tb68 only last Composer, in Tb78 and later for all composer windows)
  • added localization
  • added restrictions / explanations for users with Standard license and users without licenses
  • added a feature comparison chart to the support site
  • fixed display of trial date on license tab in settings
  • improvements for templates with tables that do not contain %cursor% (see issue If no %cursor% is entered, HTML template may be truncated / reformatted at the end #149)

Thunderbird 68: smartTemplate-fx-2.17pre71.zip
Thunderbird 78 - 91.*: smartTemplate-fx-3.8pre139.zip

To install these prereleases, as usual, download the zip file that matches your Thunderbird version and then drag the file into Thunderbird ADd-ons Manager

@RealRaven2000
Copy link
Owner Author

RealRaven2000 commented Oct 25, 2021

Implemented in version 3.8 - please note that for Thunderbird 68 you have to install new versions from the github releases page.

Unfortunately thunderbird.net does not accept updates for legacy versions anymore - they only support the new "Mail extension" format and our "mail extension with experimental APIs" which is a workaround for missing advanced features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant