Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 7248 invoked from network); 2 Dec 2005 09:01:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Dec 2005 09:01:04 -0000 Received: (qmail 30028 invoked by uid 500); 2 Dec 2005 09:00:57 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 30008 invoked by uid 500); 2 Dec 2005 09:00:57 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 29997 invoked by uid 99); 2 Dec 2005 09:00:56 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2005 01:00:56 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [64.81.120.228] (HELO mail.transmorphix.com) (64.81.120.228) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 02 Dec 2005 01:02:25 -0800 Received: (qmail 29783 invoked by uid 528); 2 Dec 2005 09:00:32 -0000 Received: from brian@transmorphix.com by zion by uid 506 with qmail-scanner-1.20rc3 (spamassassin: 2.55. Clear:RC:1:. Processed in 0.043046 secs); 02 Dec 2005 09:00:32 -0000 X-Virus-Scanned-Mail-From: brian@transmorphix.com via zion X-Virus-Scanned: 1.20rc3 (Clear:RC:1:. Processed in 0.043046 secs) Received: from ripper.tmx (HELO ?192.168.10.105?) (192.168.10.105) by 0 with SMTP; 2 Dec 2005 09:00:32 -0000 Message-ID: <43900CF5.9020001@transmorphix.com> Date: Fri, 02 Dec 2005 02:59:33 -0600 From: "Brian K. Wallace" User-Agent: Thunderbird 1.5 (Windows/20051025) MIME-Version: 1.0 To: Jakarta Commons Developers List Subject: Re: [email] Using Templates for Mail Message References: <20051202072527.62276.qmail@web33004.mail.mud.yahoo.com> In-Reply-To: <20051202072527.62276.qmail@web33004.mail.mud.yahoo.com> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Herak Sen wrote: > Hi, > A very common method which I use for setting messages is by loading from an external file and replace some tokens with desired values. > For e.g. > ------------------------------------------------------------------ > AUTO-GENERATED MESSAGE FOLLOWS. PLEASE DO NOT REPLY TO THIS EMAIL. > ------------------------------------------------------------------- > Hello, > You have been successfully registered. > Login Detail > login :@LOGIN@ > pwd :@PWD@ > ----------------------------------------------------------------- > After reading this file, I replace @LOGIN@ and @PWD@ with the appropriate values and then send the contents. > I was wondering whether such feature could be incorporated in API. > There could be a class something like the following > public class Template{ > private String template; > public Template(InputStream in){ > template=loadTemplate(in); > } > public String replaceTokens(Map map){ > //Replace all string within @@ > return template; > } > } > > May be have a more sophisticated implementation for various data sources. > Please share your views. > > Thanks > Herak This appears to me to be outside the realm of [email] itself. Not discounting the number of times this type of templating is performed - just seems outside the scope of the email project. My .02 Brian -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) iD8DBQFDkAz1aCoPKRow/gARAq5WAKDQvyPU9FXdAusX9Df82AWYhJNt6ACg6hdD dKPEW13aHtCdPcuHKGuK6Hw= =kcL3 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org