realraven2000 / smarttemplates Goto Github PK
View Code? Open in Web Editor NEWThunderbird Add-on: SmartTemplates
Home Page: http://smarttemplates.quickfolders.org/
License: Other
Thunderbird Add-on: SmartTemplates
Home Page: http://smarttemplates.quickfolders.org/
License: Other
Linked to this issue:
#39 (comment)
The location where the text is removed is where TB puts the file link if I use the FileLink feature:
I would expect this to happen above the new signature where I added my new text. Which is what TB does when I disable ST4 (just checked). So, there appears to be several issues with such emails when ST4 is used.
We want to be able to make optional sections, similar to the %identity(addressbook)%
functionality, so that it is possible to not display a line with label + data, if the data cannot be retrieved. This should support data from all additional strings supported since #25.
Example:
<h3>Sender Info</h3>
[[Mail: %from(mail)% <br>]]
[[First Name: %from(firstname)% <br>]]
[[Name: %from(name)% <br>]]
[[Additional mail: %from(additionalmail)% <br>]]
[[Work City: %from(work.city)%<br>]]
[[Web Page: %from(work.webpage)%<br>]]
[[Private City: %from(private.city)%<br>]]
[[Private Page: %from(private.webpage)%<br>]]
Any line that doesn't retrieve data and is wrapped in [[ double square brackets ]] should be omitted.
In a configuration where both Stationery templates and SmartTemplate external templates are configured within a dropdown menu, the templates from SmartTemplate do not trigger the composer window.
Instead, if the debug switch for fileTemplates is active, there is a message in error console:
+======++++++======++++++======+\nNo click event fired for button id=...
In order to build portable, more complex templates the %file( )%
variable should support 2 new functionalities:
%file(img/footer.png)%
should be allowed.%file( )%
variables contained in other files loaded via %file( )%
or from the templates selection menus on the write / reply / forward buttons.The functions %replaceText% and %deleteText% only work in the template and quote header, but not in the quoted email when replying. We need some functions to remove (or replace) text / html from quoted material.
I think it is also important to specify a minimum quote level starting with
0 = all quoted material
1 = work from the first email replied to and all contained quotes
2 = work from the "quoted quote" and all sub quotes
3 = work from the 3rd quote level onwards...
etc,
This way it could be used to remove images from older emails in a thread to conserve disk (and server) space.
Proposal for 4 new functions:
%deleteQuotedText(searchText,quoteLevel)%
%replaceQuotedText(searchText,replacementHTML,quoteLevel)%
%deleteQuotedTags(cssSelector,quoteLevel)%
%replaceQuotedTags(cssSelector,replacementHTML,quoteLevel)%
Examples:
1 - replace all images containing attribute moz-do-not-send=false from 2nd quote level onwards and replace with [SNIPPED]
%replaceQuotedTags("img[moz-do-not-send=false]","[SNIPPED]",2)%
2 - remove the sentence "Message received from external source." from quotes:
%deleteQuotedText("Message received from external source.",1)%
The time stamps in email headers always use "universal" time, e.g.
Date: Wed, 7 Aug 2019 16:58:51 +0200
The time here is the local (server) system time and the offset is the system's offset to UTC (==GMT). So in this example, the UTC time would be 14:58:51, which is what would be expected when using
%X:=timezone(UTC)%
In this case, %date_tz% should also output "0000" and %tz_name% should print "UTC".
It doesn't do that currently, though. I haven't figured out what calculation it uses, but I believe it has something to do with the client computer's time zone.
This is how it should work IMO:
With this, the time will always be correct no matter in which time zone the user wants to output it.
We need a function to remove patterns such as "Re: Fwd: [AW:] " etc. from the subject line. the ordinary %header.set%
, %header.prefix%
and %header.append%
functions are not suitable. Since this is generally mainly useful for subject lines a dedicated function will be in order.
Syntax:
%header.deleteFromSubject(pattern)%
The patter should be wrapped in double quotes " ".
Example
%header.deleteFromSubject("([\[\(] *)?(Re|Fwd|AW?)*([-:;)\]][ :;\])-]*)|\]+")%
this will remove unwanted prefixes from the subject line
We need the ability to add external Templates from an URL something like http(s)://www.mydomain.com/mytemplate.* (such as .htm, .html or .php).
This we need for all cases means write, reply and forward.
The HTML Template should have to contain the complete html Markup with complete Meta Tags, it's not same than the current template system.
SmartTemplate4 already reads and use the addressbook fields %firstname% & %name% from a given email address.
It could be nice other addressbook fields can be read in the same way.
Hi, can I use ST4 for randomly (or anything looking as random) choosing a banner out of a given set of images and inserting it below signature?
When opening a message in a single message window, the write / reply buttons have no file template submenus. These buttons should have the same dropdowns as a message in a tab to enable using html templates for replying..
So as said in title it could be nice to get a header option/var to ask acknowledgment of receipt.
When using file templates while a signature is defined, an image containing a local file source:
<img src="file:/// ...">
...will trigger the warning / notification about blocked content. Since this is a local file we should not have to unblock it.
The problem can be worked around by using a %file( )% link in the signature instead.
This happens when Thunderbird starts up without any single message window open. Once a message is double-clicked in a single message tab, the buttons in the header area are missing the dropdown menus.
Known workaround: have a single message open when shutting down / restarting Thunderbird.
If an image has encoded characters in its patch, such as:
<img src="file:///C%3A%5CUsers%5CJohn%5Cimg%5Cimg3.png">
it will not be inserted properly. Instead SmartTemplate⁴ will assume that %3A% represents an unknown header variable and will do replacements leading to the image not functioning poperly.
With the feature "resolve name from address book" enabled, and if a match is found, the variable switch (lastname)
can falsely retrieve the display name or first name instead. It happens when the name in the email address is only a single fied, such as [email protected].
In this case if the AB matches a contact with the following card detail:
first: John
last: Smith
display: Joe
email: [email protected]
Dear Mr. %from(lastname)%
becomes:
Dear Mr. John
When using SmartTemplate4 along with Virtual Identity, the reply headers generated by SmartTemplate4 are duplicated.
I've been having this issue for many years already but could not figure out the relationship with Virtual Identity.
I also reported the issue in the Virtual Identity repo since I cannot figure out the responsability:
absorb-it/Virtual-Identity#21
Versions:
Thunderbird: 60.7.0
Virtual Identity: 0.10.3 (2018-09-28)
SmartTemplate4 2.0 (2018-12-28)
If Lightning is not installed, currently the new "file templates" function will not load the template, but may open 2 composer windows instead.
According to commit history, the addon license was changed from GPL3 to CC BY-ND 4.0 in version 1.5.
Currently (with version 2.2.2), the addon is still listed as licensed under GPL3. (I do not mean in the addon / version description, I mean in the addon metadata that causes the description page to include "Released under GNU General Public License, version 3.0" in the right-side column.) Please correct this.
In fact, except for 2.0, every version since (and including) 1.5 has been listed as GPL3 (again, in the addon metadata). It would be good if these past versions can be corrected as well (if possible).
We need a way of switching the current language in a template. At the moment I have to do this manually with my German templates by right-clicking the email text and then selecting languages / German
A combined variable of the following format would be good:
%spellcheck(language[,toggle])%
With language being the locale (e.g. en, en-uk, de, es, fr, ru etc.) and toggle (optional parameter) being either on or off to change the automatic spellcheck option shown in the menu above.
Example:
%spellcheck(de,on)%
Hi.
I'm sorry if this is really the most unorthodox possible way to ask you, but I was wondering if you just so happened to have access to this extension or its source code.
Thanks.
If an account has no default identity it should log this in the Javascript error console. Instead the validation fails silently and the following error is shown:
Error in QuickFolders.Options.decryptLicense():
logDebug is not defined quickfolders-register.js:552
%identity%
should be extended to retrieve addressbook info for additional detail, in the same manner as the other address variables (%to%, %from%, %cc%
etc). This can be useful for adding address and contact information based on current identity at the bottom of the email. The entry should be resolved via the email address of the identity. To switch on this behavior, use the parameter "addressbook", followed by the desired addressbook fields, e.g.:
%identity(addressbook,name,workphone,work.department)%
SmartTemplate⁴ needs to support external HTML files in a similar fashion as is currently supported via the Stationery Add-on. This means I need to build UI for managing external file lists for write, reply and forward and integrate them with the appropriate buttons (dropdowns like in Stationery would be ideal, as they only require a single click to be activated)
It appears, setting the "from" field with the command
%header.set(from,"[email protected]")%
is not currently working in Thunderbrid 60.9
The following CSS style:
style="width:100%;table-layout:fixed;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;"`
is falsely recognized as a SmartTemplate⁴ variable and removed. This will lead to faulty CSS
Hi, I use several accounts in TB and in the settings of each accounts I have a special Bcc email preconfigured for backup purposes (standard accounts settings as they come with TB (in my localized version of TB this item is called "Copise and folders", it is the second subitem in the list under each account). Before I installed ST as well as now with ST disabled, it behaves as it should - in compose window when I change the account that I will be using for sending the message, the Bcc field updates to the correct address preconfigured for the particular account. With ST enabled it des not update anymore so after I change account the Bcc is wrong.
The same happens to my addon "Copy Sent to Current" that I use. Normally on account change the default folder for saving the message copy changes accordingly. With ST enabled it does not change as it should.
Thanks for helping
Often, I follow-up on emails that I have previously answered and if there hasn't been another reply from the contact in the meantime I use my own reply for the follow-up so that my previous answer is kept. For that, I use "Reply" or "Reply-all" on my last sent email.
With ST4 enabled, in most cases this will completely remove the text I added to my previous reply, so in the email I see the original email from the contact, my added header from my previous response but not the previous signature and also not the previous text. I can understand that the signature is removed (even that should be an option, though), but my previous text is essential and must not be silently removed (well, the removal is silent, my reaction is not! ;-)). In this example, the highlighted space marks where the previous text and signature was removed:
This happens often, but not always and I haven't figured out the mechanics behind it. Nothing terribly complicated or advanced in my settings for the affected accounts either, e.g.:
It doesn't happen if I keep the shift key pressed to generate a plain-text reply email, but this is usually not an option.
Apparently, this issue exists since version 2.4 but was only found today by a user who tried to license his version of SmartTemplate⁴
This is ultimately caused by a bug in babelzilla.org which replaces HTML encoded entities such as >
and <
with the actual characters on import, leading to unparseable language resources. I had addressed this by moving all strings with HTML entities to separate files settings-html.dtd
, but when merging changes from Babelzilla sometimes the Czech locale gets accidentally overwritten.
According to 2 users, they sometimes do not get the templates displayed that they configured for the reply menu and they have to be forced to be rebuilt by opening the SmartTemplate4 settings dialog.
So far I haven't found the reason for this or was able to reproduce it.
To gain additional messages from the JS Error console, go to ST4 advanced settings and enabled Debug mode. Also right-click and enable this additional option:
extensions.smartTemplate4.debug.fileTemplates = true
When a file template is opened via the new menu, all items in the <head>
section are moved to the <body>
of the new email, it would be better if anything in <head>
could be merged into the <head>
of the mail.
I have a secondary, non-default identity for an email account that I have defined a signature for in TB account settings. Since signatures are different, I use %sig% in ST4 template, e.g. in the "Reply" settings.
In TB, when I do a "Reply" for an email, it first comes up with the default-identity signature which is fine. In the "From" field, I now switch to the secondary identity which causes the signature to change accordingly, so at first glance it appears correct. However, any changes I do to the signature in TB account settings are not applied, not even after a restart, it always stays the same. ST4 seems to have captured this signature once for the %sig% variable, but not updated it after.
At the moment, no template is used when a mailto link is followed with anything as a body argument. It should be possible to
%mailto(body)%
Intermittently, the %spellcheck(language)% variable sets the language but does not remove the "false proofing lines" (wiggly red lines) under correctly spelled words according to the newly rejected language.
This was first suggested in a comment on #24 (changing the template from composer). The commenter @GrantHorizons references the (now defunct) quicktext Add-on, which seems to have added toolbar items with menus. I haven't used it personally so I am not to sure about this UI.
I have 248 templates in QT, and in around 21 categories - which makes for a busy toolbar row of dropdowns! MANY are only used rarely, but they're long so it's useful to have them pre-done. I use maybe 20-30 daily.
SmartTemplate with it's more advanced functionality and active support would be an ideal candidate to implement QT into.
I'd want the "shortcut keys" of QT too, as I know that saves a LOT of time. Depending on what I want to insert, a single keystroke/tab inserts any of 36 templates instantly. Nice!
From there, a drop-down menu to choose from, with sub-menus, would be great. If that menu could also be activated optionally by a %menu% for example built in to a template, that would be nice, although it's important to be able to insert a template anytime anywhere. I often use different signatures depending on who, subject, status etc of the subject.
For the moment let's only put down the requirements, without specifying the exact UI:
Note: the current file template management UI is a little lacking as you can only add single files, it would be better if that could add multiple files or support drop and drag. It may not be a good idea to use the current paradigm (account dropdown) for managing smart snippets.
For easier modification, add a new menu item "Configure menu items..." to each of the html file template drop down menus.
Add a switch that allows selecting a different language for the automatic spell checker.
%spellcheck(language)%
language can be any locale string of a dictionary that is already installed, e.g. en, de, en-GB etc.
Das alte %dateshort% hatte folgendes Format:
z.B. 01.01.2019 01:01:01 (Sekunden bin ich unsicher)
auch lt. Beschreibung:
%dateshort% = Kurzformat Datum und Zeit (z.B. 01.01.2000 1:23:45)
wobei hier in der Beschreibung die führende Null bei den Stunden fehlt.
Aktuell liefert %dateshort%
für das Datum kurze Zahlen, also ohne führende Nullen und zwischen Tag und Zeit ist ein Komma, Sekunden sind entfallen
z.B. 4.7.2019, 09:03
Request: Tag und Monat wieder mit führende Nullen; der Entfall der Sekunden ist begrüßenswert
Ein Workaround wäre %d%.%m%.%Y% %H%:%M% allerdings müsste das mehrfach an einigen Rechnern geändert werden
This is probably related to issue #3 - this can be seen in the error console as:
getLocale() returns: undefined
the function getLocalePref()_ used to call nsILocaleService.getAppLocaleAsLangTag() which is deprecated. It was changed to nsILocaleService.requestedLocale which is wrong and should be locale.getRequestedLocale().
Also matching the requested locale (e.g. "de-DE") may not correctly match with the identifiers of the languages supported by SmartTemplate (e.g. "de"). The matching algorithm needs to be improved.
Using the %file(template)% syntax fails on Mac - reported on SmartTemplate 2.8. This is caused by a file path starting with /user.
I'm using CardBook extension as the default TB Address book is very limited - but there seems to be no way to get SmartTemplate4 to use CardBook. A "Which Address book to use?" question would be useful! And which address book IN Cardbook too.
thanks!
This can happen if a file template is used but the option "Replace line breaks with
" is selected under the Account's Write / Reply or Forward template.
Workaround: disable the option "Replace line breaks with
"
In some cases, when opening a HTML template, ST4 wrongly displays the message "could not load the file template 'name' from path: ... The file may have been removed or renamed."
This is caused by a missing variable "Stationery" during charset detection and triggered by the following conditions:
if (bom.charCodeAt(0) == 239 && bom.charCodeAt(1) == 187 && bom.charCodeAt(2) == 191) bomCharset = 'UTF-8'; //UTF-8 BOM
if (bom.charCodeAt(0) == 255 && bom.charCodeAt(1) == 254) bomCharset = 'UTF-16LE'; //UTF-16 LE BOM
if (bom.charCodeAt(0) == 254 && bom.charCodeAt(1) == 255) bomCharset = 'UTF-16BE'; //UTF-16 BE BOM
SmartTemplate4 already reads and use (cf. ST4 settings) the address books fields %firstname% & %name% from a given email address.
It could be nice to have variables with every address books fields.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.