Bugzilla@Mozdev – Bug 24993
Support %subject% %to% %cc% etc. in new messages
Last modified: 2018-12-24 06:34:31
You need to log in before you can comment on or make changes to this bug.
I type the subject in compose window for new message and the variable %subject% fill the content instantly => the same like the TheBat! Mailclient
the question is how can typing the subject "fill the content instantly"? Once you type the first letter in the subject and replace the %subject% tag it won't know what and where to replace anymore. There are 2 alternatives: 1. replace the %subject% before when the users clicks send. This would be the safest way (as only then you can be sure that the subject has been completely finalized). Disadvantage: not very intuitive for the users (they won't know that it works until the hit the 'send' button) 2. replace the %subject% once the subject textbox looses focus. Advantage: kind of intuitive as it give instant feedback Disadvantage: this can only be done once, the "copied subject" in the email text could not be updated later if the user edited it again (as the %subject% variable would now be replaced). There might be some workarounds for this when editing in HTML mode (e.g. a div class). Personally I would favor (2) as it is less prone to errors and probably reasonably simple to implement.
In reply to comment #1: Maybe replace %subject% when the textbox loses focus, but undo that replace if the textbox regains focus during the same session? Do you think it would be (a) possible; (b) useful? (Of course, also replace it if the message is sent by hitting Ctrl+Enter or something while the textbox has focus.)
(In reply to comment #2) > In reply to comment #1: > Maybe replace %subject% when the textbox loses focus, but undo that replace if > the textbox regains focus during the same session? Do you think it would be (a) > possible; this is difficult, probably not worth the effort > (b) useful? anything that saves the user work can be considered useful :) > > (Of course, also replace it if the message is sent by hitting Ctrl+Enter or > something while the textbox has focus.) Also replace on send, I agree. I think this is definitely useful; the difficult thing is to make sure users do not delete it or think it is a bug if they do not write anything in the subject line.
This one could open up a lot more useful features once the problem of "late resolving" of variables is cracked. Basically ST4 does its processing when Composer opens, but for this one we would need to resolve the variable (%subject%) to a temporary placeholder tag (e.g. <span>) <span id="SmartTemplate4_subject">%subject%</span> and then have an event (e.g. subject textbox losing focus) which would update its content. The tag would also have to be removed on send in order to "finalize" the operation and avoid accidental replacement on subsequent replies. We could also add a "Update fields"button (like MS word had it) maybe?
I am adding support for "late resolving" of missing headers with the new clickable ST4 fields feature. These variables will be shown with a colored (pink) placeholder that can be clicked during composition of the emails.
Created an attachment (id=8532) [details] 1.6 prerelease 139 With this version, the following functions can now also be used in "New" Emails: %subject% %to% %from% %cc% %bcc% these will be pulled from the address widget / subject line when the colored field is clicked on. Clicking can be done multiple times so subject line can still be changed and updated. A separate button for the composer toolbar is provided to "clean up" all fields before sending - this means any special code that makes these variables update / look different is removed and the content is finally inserted as "normal text". Also supports the new %dateformat% from [Bug 26588]
Created an attachment (id=8534) [details] 1.6 prerelease 168 Added support from the variables tab and slightly better styling behavior. Variables tab Added a new color / behavior for the variables that can now be added to the "New" template. These (orange) boxes can now be added just like the green ones without triggering the Warning "the variable xxx cannot be user for new messages" Styling The orange / pink field styles are now loaded only when the Composer is opened. (Unfortunately it still affects the main window as well at this point in time) Links to Bugs links to Bug descriptions in the Variables tab now open a new browser tab in Thunderbird
Created an attachment (id=8546) [details] 1.6 prerelease 244 After some more testing, I also support this type of "Late variable resolution" on address fields in forwarded emails. In order to distinguish it from the original headers, you need to add the parameter "fwd" in the address parameters. Example: %to(firstname,fwd)% - will fill in the firstname of the Addressee field once clicked %from(email,fwd)% - fills in the email address of the sent from field in the address widget %cc(name,??bracketMail(),fwd)% - fills in the name or (if name cannot be determined) <email address> of somebody the forwarded to as a cc. - without the fwd parameter, the address parameters all refer to the headers of the forwarded email as before.
Implemented in Release 2.0 (23/12/2018)