-
Notifications
You must be signed in to change notification settings - Fork 15
-
Notifications
You must be signed in to change notification settings - Fork 15
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 Support for Cardbook #50
Comments
Please note that I am using an XPCOM function for retrieving AB data - it is not clear to me where this comes from. SmartTemplate uses the
...as far as I know the interface Thunderbird 78 is planned for release in June 2020, I am very doubtful all APIs will be replaced by that time, this means SmartTemplate4 will have to be rereleased as a "web experiment", which also requires a lot of rewriting. (realisticly between 4 and 8 man-weeks) - I am currently considering which route to take; probably a kickstarter to hire an external developer for the conversion work so that I can continue working on bugs, maintenance, new features and user support! |
Going to pin this one for next implementation. Sorry for taking such a long time. It requires rewriting of pretty much all functions as "asynchronous". |
It always seems so simple - but never is. Thanks for the update |
I am also eagerly awaiting the integration of Cardbook fields into Smart template: #141 |
After such a long time, this still isn't implemented in 2023 - it's time this has to become a reality. I will need the help of Philippe (the author of Cardbook) in order to pull it off; I will ask him for some boilerplate code on our next Add-on Developer meeting (next Thursday). |
I'd also love to see this integration. Both SmartTemplates and CardBook are powerful tools I use regularly. |
Working on this right now, the very step is to make all calling functions async. which also means the main parser (in the experimental code) needs to become async. I have already done similar work in the (unfinished) web extension portion of the code (files starting with st-) so I am hopeful I can reuse some of that code. The main module that pulled everything together for the "mx compatible" method (which is incomplete due to lack of UI cooperation) is st-parser.mjs.js. |
List of functions that need to be async-ified - initial list as starting point:
Problem with this might be a major problem, (close to a showstopper) as Thunderbird surely calls this as a sync function. Need to check the Thunderbird source code, to see what it does "afterwards". Reminder - you can all an async function from a sync function, but you cannot "await" its result - the calling code will just continue relentlessly (even if LoadIdentity is still working or working later on). in |
next to asyncify:
also
Still getting a "promise" output in resulting mail, so I am probably missing at least one await somewhere. Also the missing from / to headers may be a problem of call order, not sure yet. Are these headers available at time of replacement? |
First test version with async processing - still some problems with address headers but it's a start: smartTemplate-fx-3.16pre31.zip once async works reliably I can start tests with Cardbook's new interfaces. |
Asyncified code some more, see below. THis is before adding any of Phillipe's functions (CardBook). smartTemplate-fx-3.16pre36.zip Will probably commit this changeset to ESR91 - I will test this version on my production profile for a day or two before doing the actual Cardbook notifications. Might have to add more async;ified code before that. |
Structure of a card returned by cardbook (below). Spelling & names obviously different from normal AB format. I am missing note the legacy card structure had a property "vCardProperties"
|
I just did a first check in after writing conversion code for Cardbook formats. Here is a first build that does something worth testing: smartTemplate-fx-3.16pre50.zip Added a special switch that needs to be activated in about:config. Just set
to activate Cardbook support. You also need the minimal version of 84.4 which implements the prototype version of card lookup which is used to extract the data from the other Add-on: To install these preview versions, download both zip files and drag them into Thunderbird Add-ons Manager, without extracting their contents. I did turn a lot of functions into async, one major problem that remains is that the LoadIdentity function (which I monkey patched) had to be turned into async - which can lead to problems when it is called by Thunderbird itself - it may potentially execute its own code too early as it does not know that it would need to "await" SmartTemplates to finish its own processing first. |
The changeset for going async: b3206cc |
I added User Interface integration for Cardbook - find the new option to enable Cardbook on the advanced settings tab in SmartTemplates Settings: smartTemplate-fx-3.16pre61.zip UI is already translated to the supported languages. I also added a better error message (and detailed loggin in error console) if any exceptions happen during replacing of SmartTemplates variables. To install the above preview version download the zip files and drag it into Thunderbird Add-ons Manager, without extracting their contents. Note that you need at least Cardbook 84.4 installed (see version above) to test this new feature. |
A new milestone was reached - with John Bieling's help I fixed the asynchronous replacement code which broke importing other templates via smartTemplate-fx-3.16pre72.zip To install the above preview version download the zip files and drag it into Thunderbird Add-ons Manager, without extracting their contents. Note that you need at least Cardbook 84.4 installed (see version above) to test this new feature. |
Do I need the pro license to use it? I have the standard license. |
yes, this will be a premium feature, Pro License (or Domain license) is required. It's a very complex feature which required very fundamental rewriting + there is always the risk of depending on another Add-on and its potential changes. If you want to wait until it lands officially in the next version 3.16 you can save some money on the upgrade as there will be a substantial bargain offer for upgraders when I launch it. |
PS: If you want to test now, you contact me directly for a test license. |
Sounds good to me. I'll wait for the official release. Thanks! |
Here is a test version with some interesting caveats. This parses the Cardbook structure directly. But I also improved the vCard parser (which is the new format used by Thunderbird standard AB) The way I parsed the vCard structure directly wasn't optimal as there are different version numbers which are implemented differently and could lead to failures. In this version I am using the ical library to parse out a jCal (json) structure, that hopefully is version independent. Since the CardBook part is parsing the native structure I will obviously need a heads up by the author in case he wants to modify the internal structure of his card storage. smartTemplate-fx-3.16pre109.zip Test template with all supported fields |
Another version - adds improvements in vCard reading and CardBook for organisation / departements. You can now have multiple departments after the Organisation by delimiting them with smartTemplate-fx-3.16pre115.zip To install, download the zip file and drag it into Thunderbird Add-ons Manager. |
New test template: unpack the html file and add to the "reply" menu (configure menu item) or just open it directly: |
Latest version - added a "fallback to standard AB option" when contact is not found in Cardbook: smartTemplate-fx-3.16pre126.zip To try out, download the zip file and drag it into Thunderbird Add-ons Manager (don't extract contents). |
implemented in version 3.16 published on 6th of March 2023 |
Hi, I upgraded to the pro version and have used it for several weeks. It works great. Thanks! |
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!
The text was updated successfully, but these errors were encountered: