Bugzilla@Mozdev – Bug 25902
%from% and %to% - Improvements + Stability + better List support
Last modified: 2015-04-14 06:20:39
You need to log in before you can comment on or make changes to this bug.
If %to% is used in its plain form (not with an argument, like %to(name)% is throws an error: Warning: replaceReservedWords(dmy, to, undefined) failed - unknown token? format is undefined Source file: chrome://smarttemplate4/content/smartTemplate-overlay.js Line: 447 Source code: isName chrome://smarttemplate4/content/smartTemplate-overlay.js:447:29 SmartTemplate4.mimeDecoder.split@chrome://smarttemplate4/content/smartTemplate-overlay.js:512:14 replaceReservedWords@chrome://smarttemplate4/content/smartTemplate-overlay.js:1347:15 SmartTemplate4.regularize@chrome://smarttemplate4/content/smartTemplate-overlay.js:1477:1 getProcessedText@chrome://smarttemplate4/content/smartTemplate-compose.js:744:17 getQuoteHeader@chrome://smarttemplate4/content/smartTemplate-compose.js:757:10 insertTemplate@chrome://smarttemplate4/content/smartTemplate-compose.js:911:19 SmartTemplate4.notifyComposeBodyReady@chrome://smarttemplate4/content/smartTemplate-main.js:358:5 SmartTemplate4.initListener/<@chrome://smarttemplate4/content/smartTemplate-main.js:272:5 Stationery.fireEvent@resource://stationery/content/stationery.jsm:301:3 Stationery_.ApplyTemplate@chrome://stationery/content/stationery-composer.js:175:5 Stationery.onComposeBodyReady@resource://stationery/content/composer_utils.jsm:349:5 stateListener.NotifyComposeBodyReady@chrome://stationery/content/stationery-composer.js:452:3
Created an attachment (id=8001) [details] 0.9.6.1 prerelease 54 %to% will now default to name <email> In this version, I have completely re-written the address replacement routine in order to make the formatting of %to()% %from()% %cc()% etc. more easy and configurable. you can now put together the different parts in your order of choice, simply concatenating the different needed parts. For example: %to(lastname,firstname,mail,linked)% %from(name,bracketMail(round))% %from(firstname,lastname,bracketMail(square))% bracketMail is a new "subfunction" expression that "wraps" the mail part as follows: bracketMail(square)% [email] - square brackets bracketMail(round)% (email) - round brackets bracketMail(angle)% <email> - angled brackets bracketMail(D1;D2)% D1emailD2 - D1 and D2 represent wrapping characters .. when using the wrapping delimiter syntax, you can use any character apart from the special characters ,;()[] the wrapping characters are separated by ; empty characters are allowed (;) bracketMail(<;>)% <email> bracketMail(";")% "email" bracketMail(- ;)% - email default when using %to% / %from% / %cc% etc (without any parameters) is (name,bracketMail(angle))
ERRATA the expression bracketMail() should NOT have a % after it! bracketMail(square) [email] - square brackets bracketMail(round) (email) - round brackets bracketMail(angle) <email> - angled brackets bracketMail(D1;D2) D1emailD2 - D1 and D2 represent wrapping characters .. when using the wrapping delimiter syntax, you can use any character apart from the special characters ,;()[] the wrapping characters are separated by ; empty characters are allowed (;) bracketMail(';') 'email' bracketMail(";") "email" bracketMail(- ;) - email
Created an attachment (id=8007) [details] test file Here is a html file with lots of test cases. Easiest use with Stationery and just select it as template from the "Reply-To" dropdown.
Created an attachment (id=8008) [details] 0.9.6.1 prerelease 63 Fixing most bugs with %to% %from% and %identity%