[pmwiki-users] Fox and mailform / was: mailform variant 4?

The Editor editor at fast.st
Wed May 9 13:53:28 CDT 2007


On 5/9/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Wed, May 09, 2007 at 02:20:01PM -0400, The Editor wrote:
> > On 5/9/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > >On Wed, May 09, 2007 at 12:53:31PM -0500, Patrick R. Michaud wrote:
> > >> On Wed, May 09, 2007 at 12:27:45PM -0500, Jon Haupt wrote:
> > >> > After reading the contents of the mailform variants thread, I had to
> > >> > wonder if Fox could be made to be a mailform?  It might be relatively
> > >> > easy to accomplish the kinds of things we're looking for.
> > >>
> > >> FWIW, I've already got a mailform recipe waiting in the
> > >> wings for the next beta release.  I'll post a test page
> > >> with it so people can get a look at it.
> > >
> > >http://www.pmwiki.org/wiki/Test/MailForm
> >
> > I've been curious if this will allow for html enabled mail, and/or
> > markup of the body content.
>
> Yes.  The target lines in Site.MailFormList allow specifying
> a template, along with defaults.  For example, one could write:
>
>    pmichaud: to=pmichaud at pobox.com fmt=Site.MailTemplate#mail
>
> which says that the mail is to be sent according to whatever
> is given in Site.MailTemplate#mail.  For example, this could
> look like:
>
>    [[#mail]]
>    (:template defaults subject='Mail form message':)
>    (:template requires from    errmsg='$[Missing 'From:' address]' :)
>    (:template requires to      errmsg='$[Missing 'To:' address]' :)
>    (:template requires subject errmsg='$[Missing subject] :)
>    You received a message via MailForm:
>
>    {$$text}
>
>    ----------
>    Message sent from MailForm at
>    {$$PageUrl}
>    [[#mailend]]
>
> The (:template defaults:) line identifies any default values to
> be used if not specified by either the target line or by the input form.
>
> The (:template requires:) directives identify things to be checked
> before allowing the message to be sent.  In the above case, the
> template requires values for 'from', 'to', and 'subject' before
> a message can be sent.
>
> The remainder of the template is the text of the mail message.  This
> can contain any text, including HTML.  For mail messages, the
> template text is not interpreted at all, other than to perform
> value substitutions of any {$$...} sequences.
>
> I'm still working out some of the the minor details, but this is
> the broad outline of how I expect it to work.


Very nice as always.  Is it possible to render markup on some text so
wiki markup could be sent in the email message, perhaps conditionals,
etc? I'm even thinking mail merging with text vars from a profile page
or whatever.

If you are not moving that direction, could you suggest how to do it?
Just run PRR on the output, and maybe cap it with a <html><body> +
ending tags?  I've had someone ask for this, and it seems it shouldn't
be too hard to implement in ZAP. Though it could introduce some
complexities...

Cheers,
Dan



More information about the pmwiki-users mailing list