Anyone interested in Twig templates for Mailchimp and/or Mandrill?
I use Twig to customise templates on site before sending them off to Mailchimp. Twig is what we will all use in D8 and it is compatible with D7 plus it is compatible with Mailchimp templating.
You can do anything with twig before sending the template to Mailchimp to start a new campaign or to update an existing campaign. I skipped twig the first time I connected a site to Mailchimp because there was nothing dynamic in the email other than the list fields and a few almost static site specific items. The next email needed some things that varied from month to month. The easiest approach is listed next. If anyone else wants something similar, I am happy to work on it.
- Create a Twig template in a Cel (Cel module).
- Create a view to list content.
- Create a Webform to provide the request input.
- Create a tiny module to take the request from the Webform, feed it into the view, then feed the result into the template using the Cel Twig module.
- Send the result up to the campaign using the details supplied in the Webform.
The combination means everything can be delegated to the person who manages the mailout without a developer involved beyond the initial module installation/dev.