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
%to(addressbook,other.custom*)%
not working from smart fragments menu [Cardbook]
#246
Comments
Could be a compatibility bug in Cardbook |
Ok. could you export one contact for me for testing please? Please send to thunderbirddaily@gmail.com, please reference [SmartTemplates] issue 246 in the subject line, if you want to send it off Github. Also, I while testing I discovered a bad issue #247 that breaks the templates file in all versions of SmartTemplates 4.0, so don't try to add templates to the menu until that is fixed (is going to go into the next beta with high priority) |
Thanks for sending test data - I couldn't reproduce the particular p[roblem (TypRror: nodeList is undefined), I got partial data back but didn't get the data for "other1, other2": It looks like in my previous test versions I would have expected a array member looking like this: "VALUE:some string" but we see this data in card.others (information partially redacted):
|
Below is a test template for all Cardbook / Addressbook fields |
The error of nodeList = null seems to point to the way you are using the field. Interactively? from a plain text message? If the account template contains the address book fields, can you please export your smartTemplates account templates : too? (this includes all the data on the left side of the dialog for the selected account) |
Here is the exported account json |
now it gets weird. |
great that helps. I am inserting HTML elements into the document and they are later resolved in form of a list. Maybe that fails with a document that's pulled from the smartTemplate menu. For more info in error console, please install the version below smartTemplate-fx-4.0pre274.zip this will avoid the nodeList problem but not do anything immediately (e.g. try to insert text into the Editor immediately). I need to test first, but it should advance us a little... |
installed pre274, used my template as a template for new mail
|
Personally, I wouldn't ever use instead, use either try this instead: <p>Hi %recipient(firstname)%<br /><br />
Dein User: %recipient(addressbook,name,other.custom1,other.custom2)%
</p> |
By the way, testing with Thunderbird 102, here is what I get returned from a custom1 field: the first line is the label of the custom property "custom 1!", the second line is the contained data "C1". That's why I was looking for "VALUE:(some data)". So I need to check why your data is not formatted that way ... hope it is not vCard version dependant, I based it on the format that Phillipe V (the owner of the Cardbook Add-on) returned at the time I implemented the communication between ST and CB |
I am still down the rabbit hole of testing. it seems there are some "mixed up perspective" problems still when it tries to get the header variables. The function |
Ok I made some unfortunate finding what happens when we use the fragment in a reply. For |
I dealt with the smartTemplate-fx-4.0pre277.zip the upshot is that you can now edit the addresse and change the "To:" and the fragments will pick up the correct address items via |
... hmm looks like inserting a fragment via "open template file..." directly is broken, I will raise a separate bug. see #249 |
I am not sure if I can make the script commands work from a "Fragments" entry - did this use to work in Thunderbird 102? There may also be some fallout from the changes (fixes) to %recipient%. I mainly use the "insert snippet" menu for extracting information from the original mail or adding some FAQ / Layout elements, nothing too heavy that interacts with the address headers .... I made a new version over at: Are there any errors in javascript error console? (use the right-click menu to copy all messages, no screenshots please) |
%to(addressbook,other.custom*)%
not working from smart fragments menu
Since we closed #249 can we close this one as well? I am not sure if there any open issues... if it still is a problem, simply reopen this one and send the error log... |
%to(addressbook,other.custom*)%
not working from smart fragments menu%to(addressbook,other.custom*)%
not working from smart fragments menu [Cardbook]
I am just revisiting this bug to make sure it is fixed - I don't know where I can edit the "custom" values in the CardBook editor, any ideas? |
I think I managed it in cardbook settings under Custom fields, I set up this: Then I made a new version which makes sure to use the correct email when using the variables <div style="border: 1px solid gray; padding: 0.5em; margin-block: 0.5em; border-radius: 5px;">
<h3>test cardbook <i>other.custom</i>:</h3>
Recipient: %recipient(addressbook,name)%<br>
[[C1: %recipient(addressbook,other.custom1)%<br>]]
[[Shoe Size: %recipient(addressbook,other.custom2)%<br>]]
[[YouTuber: %recipient(addressbook,other.custom3)%<br>]]
[[Support: %recipient(addressbook,other.custom4)%<br>]]
</div> The results looked correct to me - test version below: To test the version above, download the zip file and drag the file into Thunderbird Add-ons Manager without extracting contents. |
Implemented in 4.4 - published 28/03/2024 |
Hi,
TB version: 115.0
SmartTemplates version: 4.0pre256
Cardbook version: 90.4
Here is the content of my template (it doesn't matter "which" template (write, reply, forward...)
<p>Hi %to(firstname)%<br /><br />Dein User: %to(addressbook,other.custom1)%</p>
When you have NO license applied, both the %to(firstname)% and the %to(addressbook,other.custom1)% are working just fine.
Once you apply the (valid) license (all PRO features are enabled), the %to(firstname)% still works, but %to(addressbook,other.custom1)% doesn't work anymore. If you remove the license key, everything work as expected.
Tested also with other.custom[2-4].
thx in advance,
Ron
The text was updated successfully, but these errors were encountered: