You are here: Home / Documentation / How To's / How to make PloneFormGen Formated Emails

How to make PloneFormGen Formated Emails

by ledwell published Aug 16, 2016 10:50 AM, last modified Aug 16, 2016 10:50 AM
Some sample code for you to make ploneformgen emails look prettier by modifying the "Mailer" template.

Disclaimer: I'm a artist, and fairly slow at getting my head around the code like tal and python expressions, so Josh Klotz helped quite a bit on the stuff below. Got a problem, blame him :) . I will try and add more to this as I have time but I was hoping to give people some starter code to work with because I had a hard time finding anything that I could understand online about modifying the "mailer adapter".

What we want to do is to modify the template of the "mailer adapter" to include the fields we want in a very specific way.

mailerAdapterSet up

  • Make sure "PloneFormGen" is installed
  • Create a form
  • Inside that form either edit the existing "mailer adapter" or create a new one by choosing "add new" - "mailer adapter"
  • You will probably want to add a couple "FormStringFields"
  • Choose the "mailer adapter" you want to modify.
  • Choose the "template" tab

Modifying the Template

You should see code in the template that looks like this..


        <tal:block repeat="field options/wrappedFields">

<dt tal:content="field/fgField/widget/label" /> <dd tal:content="structure python:field.htmlValue(request)" />