Plugin Newsletters: Can't edit newsletter display squelette (not newsletter templates)

I would like to add some custom html to the newsletters after they are published.

I know I can edit the newsletter template in newsletters/* but these are cached statically in the db once a newsletter is computed.

I don’t understand how I could add some code such as [(#SESSION{id_auteur}|oui) custom code] to the pages that display published newsletters.

What is caching/fixing the code of these pages? Is there a pipeline I could use or some other way?

I hope it’s clear.

Kind regards,
Urs

I would like to add some custom html to the newsletters after they are published.
I know I can edit the newsletter template in newsletters/* but these are cached statically in the db once a newsletter is computed.

You mean « Edit a copy of the newsletter template in the site’s specific template folder » ?

But see with var_mode=inclure : the template that displays publicly the HTML is not in newsletters/*, it’s /newsletter.html at the root of the templates folder.

I guess newsletters/* templates creates the static cache while /newsletter.html displays it publicly.

I don’t understand how I could add some code such as [(#SESSION{id_auteur}|oui) custom code] to the pages that display published newsletters.

While editing /newsletter.html in your site’s local template folder, you can achieve anything you want : including using #SESSION and apply a filter to #HTML_EMAIL depending on the sessions value or lack of value.

Just beware doing so will not enable SPIP to cache the public newsletters pages of logged users.
In case you got lot of logged users, you might want to use macrosession plugin.

JLuc

No @JLuc this is a wrong answer as it’s only going to fake the displayed newsletter, not the one sent by email, and likely not work as visitors have no session

@Urs_Riggenbach you can use variable in the HTML when you edit the generated HTML of the newsletter, like @nom@ @email@ or @lang
see Newsletters - SPIP-Contrib and Mailshot - SPIP-Contrib

There is no #SESSION you can refer to as the newsletter is computed outside any visitor session

Hello All,
Thank you for the helpful answers.

I think JLuc you are right to suggest /newsletter.html - and that’s what I’ve tried but it didn’t work.

I tried on another site using this excellent plugin (thank you), and it worked.

I tracked it down to the CacheCool plugin that prevented the recalculation of the newsletter squelette.

I think that explains why I was stuck!

Kind regards,
Urs