Newsletter: "Import list from Function"

Topics: Standard packages
Mar 9, 2011 at 1:09 PM

Today we can "Add new [standard] mailing list" or "Import lists from Data Type" but that is not flexible enough for us.

We need a new “Import list from Function” option that returns custom XML.

The XML should have a predefined element structure with one predefined attribute called "email" and a free number of custom attributes.

The XML structure could be like this:

<Members>

<Members email=”xx@acto.dk” name=”Søren Larsen” shoesize=”42” />

</Members>

I might be tricky so maybe we need to discuss the possible solutions.

Mar 22, 2011 at 9:42 AM
Edited Mar 22, 2011 at 9:45 AM

slacto,
This is great idea.. and it's done & online now! Please check Composite.Community.Newsletter version 1.5.1 - it's containing FunctionBased mailing list support.

Quick how to import List from XSLT Function
XSLT function must return XML that lists members by using <Member /> element for each member. The <Member /> element must include the attribute named "Email" with a valid email address as its value. This element can also include custom attributes (fo example, Name, Company, etc).

For example:
 
<Members>
  <Member Name="John Doe" Email="john.doe@contoso.com" />
  <Member Name="Jane Smith" Email="jane.smith@contoso.com" />
</Members>

To import the list from an XSLT function:

   1. In the Content perspective, select Newsletters and click "Import List from XSLT Function" on the toolbar.
   2. Specify the Title and write the Description in the dialog.
   3. Specify the XSLT Function that meets the requirements described above and click Finish.

If return XML from XSLT function changed (for example you added new field), you need just edit mailing list and re-save it - Newsletter will pickup new data structure.