Archive of UserLand's first discussion group, started October 5, 1998.

MTTF and templates

Author:Dave Winer
Posted:2/27/1999; 7:50:50 AM
Topic:Mail to the Future Server Functionality
Msg #:3290 (In response to 3027)
Prev/Next:3289 / 3291

OK, Mail to the Future gets even more robust today! We now have a provision for templates on the server. No, it's not a framework, just a simple provision that allows XML-RPC-savvy clients to push mail messages thru stationery.

It's low-tech and easy

Here's how it works. First, as you know, each user has a storage structure on the server that can be accessed thru "mainResponder.members.setProfilePart" and getProfilePart. The template feature builds on that.

If you have a part at mailToTheFuture.template and if mailToTheFuture.flNoTemplate is not defined or is false, then every message sent from the account flows thru the template.

The template is plain text, special elements are denoted in <>. Inside each <> put the name of one of the fields of the message, like <> or one you invent, <>. When the message is sent the message flows thru the template, each bracketed element is replaced with the value of the field it refers to.

Example

An example, in my MTTF table, I have a template:

This is a MTTF message send by Dave Winer thru a customized template.
Here's some information about this message. 
It was inserted on <>. 
The subject is <>. 
The message said: "<>". 
That's all for now!

When I get a piece of mail sent thru that template, here's what I get in my inbox:

From: dave@userland.com
X-Mailer: UserLand Frontier 6.0b3 (Windows NT)
Date: Sat, 27 Feb 1999 16:00:00 GMT
To: dave@userland.com
Subject: Hello World

This is a MTTF message send by Dave Winer thru a customized template. Here's some information about this message. It was inserted on 2/27/99; 7:58:06 AM. The subject is Hello World. The message said: "This is a test message for people learning about MTTF templates". That's all for now!

What is this good for?

Glad you asked! Canter & Company, as you know, are developing a DHTML interface on MTTF. One of the excellent features is stationery. So when they ship a message up to the server, they also ship graphic parts into the message table. When the message is sent, by the server, all the pieces are mashed together using the template. They assume that the recipient has an HTML-friendly emailer, such as Microsoft Outlook (in its various flavors). It's like "Blue Mountain Arts", right in your mailbox! I've seen it, soon you will too, it's coooool!




There are responses to this message:


This page was archived on 6/13/2001; 4:48:09 PM.

© Copyright 1998-2001 UserLand Software, Inc.