-----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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]