WebHare 4.16 adds PrepareMailWitty as a replacement for the MakeEmailComposer API. We may deprecate the old API in the far future. New projects should always use the new API .

Simple usage:

  OBJECT outmail := PrepareMailWitty(Resolve("mytemplate.witty"));
  outmail->mergerecord := [ firstname := "Lisa" ];
  outmail->QueueMailInWork();

with the following Wittytemplate:

<html>
  <head>
    <title>My subject</title>
  </head>
  <body>
    <div id="test">Hi [firstname]</div>
  </body>
</html>

Templates

PrepareMailWitty can wrap the email in a template by specifying a witty resource as the 'mailtemplate' option. A mailtemplate looks like this:

<html>
  <body>
    <div>Standard header</div>
    <slot name="mailbody"></slot>
    <div>Standard footer</div>
  </body>
</html>

The slot[name=mailbody] element is replaced with the original email. Stylesheets, mailsubjects and wh-mailcomposer- metatags are also merged into the original email.

Other features

Comments