Open RealRaven2000 opened 1 year ago
On top of the above - the original poster (OP) for this issue is using a remote address book via the CalDav/CardDav provider and no other address variables resolve to any useful data (all blanks) - which is the underlying problem of having to call the faulty fallback code in the aforementioned lines. This is caused by trying to populate the first name with the preferred nickname.
Here is a quick fix that will remove the error message caused by "Prefer nickname" but will not fix the problem of CardBook not returning data:
smartTemplate-fx-3.16.1pre4.zip
To install, download the version above and drag the (zip) file into Thunderbird Add-ons Manager. it will remove the faulty error message. However if Cardbook does not return data this is still an issue to be fixed.
Technical note on the difference in the quickText Add-on (which according to the OP retrieves the data successfully) - this uses an internal interface of cardbook:
https://github.com/jobisoft/quicktext/blob/TB102/chrome/content/modules/wzQuicktextVar.jsm#L783-L803
let cardbookRepository = ChromeUtils.import("chrome://cardbook/content/cardbookRepository.js").cardbookRepository;
let card = cardbookRepository.cardbookUtils.getCardFromEmail(aIdentity.email.toLowerCase());
this kind of access it of course discouraged because it hinders future-proofing our Add-ons and keeping them independent from each others internal structuring.
It appears that when using the CardBook extension to replace address variables (such as
%from(addressbook,nickname)%
or just%from(nickname)%
), SmartTemplates doesn't resolve the address and shows this message instead:According to the debug log:
Looks like there is some fallback code here that uses
card.getProperty
without a fallback. (getProperty should not be used if it doesn't exist - as in modern Thunderbird platforms.smartTemplate-overlay.js, line 1424: