dpi / courier

Courier is a Drupal module providing a framework to send messages to entities.
https://drupal.org/project/courier
GNU General Public License v2.0
8 stars 3 forks source link

Support twig for advanced personalisation #20

Open mirodietiker opened 8 years ago

mirodietiker commented 8 years ago

With Drupal 8, we have twig.

Natively supporting twig would be of great advantage. Body could easily contain conditional segments.

Placeholders would be converted to leverage twig as much as possible.

In a perfect world, we could write a ckeditor plugin and have buttons and visual support for twig.

Dunno if we would want to support it as a separate text format and still support previous notation in parallel -- or if switching to twig only is an option. Auto conversion of existing mails might be hard / impossible.

dpi commented 8 years ago

I'm up for any suggestions regarding theming output. Courier currently takes the input from the template textarea, simple search and replace for tokens, and queues for sending. If you have technical suggestions on adding a theming layer I'd love to hear it. Unfortunately I'm not fluent on the nitty gritty internals of the Drupal theming/rendering/TWIG systems.

If I am interpreting your request correctly; I imagine there would be little, if any, interruption to existing site installations.

Berdir commented 8 years ago

Yes, technically, the easiest way to do this would be to treat the template like an inline template and pass the available context to it. Building a UI for what you can do would be the hard part.