Forum OpenACS Q&A: Stored email templates

Collapse
Posted by Dave Bauer on
We have several competng implementations of the idea of email templates, that is the text of an email saved to be sent out when someting happens.

First of course, are the built in, registration etc emails. These are usually hard coded in the tcl files or added as message keys.

Second is the bulk-mail package. These are saved for one time delivery and not reusable (although there isn't any reason a user interface for this could not be created).

Third is the dotlrn_member_email feature which powers the welcome message when a user is added to a community, and also powers the triggered emails in the dotlrn-ecommernce package when a user applies for a course, etc.

There are plenty of other times we have emails that need to have stuff replaced. Notifications is another place where the content of the email is predefined and just some variables are replaced.

The contacts package has the same idea.

So clearly we have a need to be able to define the text of an email, and allow variables to be replaced within the content, then send this email to one or more users.

Right now administrators cannot edit the content of notifications, and other built in messages. It would be nice to be able to do this.

The two most fully implemented versions of this that I am aware of are bulk mail and dotlrn_member_emails. (Contacts is probably similar but I haven't used it myself.)

These use two different techniques to replace variables within the content of the email

Bulk mail uses the format {varname} and dotlrn_member_emails uses the message key format %varname%.

So the basic proposal is to create a new table to store all these emails, along with includable forms to allow the management of these emails, then of course, updating all the existing code to use this feature.

Since the core can send email it probably makes sense to make this core code once its ready.

Does anyone have any feedback ideas, or can anyone see any problems with this proposal?

Collapse
2: Re: Stored email templates (response to 1)
Posted by Torben Brosten on
Hi Dave,

fwiw, ecommerce package has email templates, too. The email templates allows some dynamic content to be added.. I'm not sure if the other email choices, do. It would be nice to retain that in the templating, but there is another dynamic templating package in the works that could replace that portion, if it is not included in your proposal.

cheers,

Torben

Collapse
3: Re: Stored email templates (response to 2)
Posted by Brian Fenton on
Also a former colleague of mine, Kevin Crosbie, wrote a template letters package which uses a WYSISYG editor to create Word friendly documents using merge fields.

You can see Kevin's original posting here:
https://openacs.org/forums/message-view?message_id=71372