Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 63744 invoked from network); 2 Dec 2005 07:26:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Dec 2005 07:26:00 -0000 Received: (qmail 51112 invoked by uid 500); 2 Dec 2005 07:25:57 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 51093 invoked by uid 500); 2 Dec 2005 07:25:56 -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 51082 invoked by uid 99); 2 Dec 2005 07:25:56 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2005 23:25:56 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [68.142.206.68] (HELO web33004.mail.mud.yahoo.com) (68.142.206.68) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 01 Dec 2005 23:27:25 -0800 Received: (qmail 62278 invoked by uid 60001); 2 Dec 2005 07:25:27 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=n6tEvEjDXkESzmBE1jal6wo+2jxukB6UoJ4KYkf0whgzBjoHiuyqlqpxzTmUZIUMcSbW6v+E9fgF5K4ezLXJ4lDZEmcWD7/olvAiDuPBY5UrHTEK1QFBG4s/K3GpdUeGKam9kmmsY7rDFKIVniIK+ddkm2GPVbALChCftuZZ5Yk= ; Message-ID: <20051202072527.62276.qmail@web33004.mail.mud.yahoo.com> Received: from [203.122.12.242] by web33004.mail.mud.yahoo.com via HTTP; Thu, 01 Dec 2005 23:25:27 PST Date: Thu, 1 Dec 2005 23:25:27 -0800 (PST) From: Herak Sen Subject: [email] Using Templates for Mail Message To: Jakarta Commons Developers List In-Reply-To: <438FF09C.8010803@ops.co.at> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1406303343-1133508327=:61975" Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --0-1406303343-1133508327=:61975 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 --------------------------------- Yahoo! Personals Let fate take it's course directly to your email. See who's waiting for you Yahoo! Personals --0-1406303343-1133508327=:61975--