Apache

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Using Templates for Mail Message

    1 answers - 1091 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    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.
    AUTGENERATED MESSAGE FLLWS. PLEASE D NT REPLY T THIS EMAIL.
    Hello,
    You have been successfully registered.
    Login Detail
    login :@LGIN@
    pwd :@PWD@
    After reading this file, I replace @LGIN@ 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
  • No.1 | | 1505 bytes | |

    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.

    AUTGENERATED MESSAGE FLLWS. PLEASE D NT REPLY T THIS EMAIL.

    Hello,
    You have been successfully registered.
    Login Detail
    login :@LGIN@
    pwd :@PWD@

    After reading this file, I replace @LGIN@ 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
    PGP SIGNATURE
    Version: GnuPG v1.2.5 (MingW32)

    dKPEW13aHtCdPcuHKGuK6Hw=
    =kcL3
    PGP SIGNATURE

    To unsubscribe, e-mail: commons-dev-unsubscribe (AT) jakarta (DOT) apache.org
    For additional commands, e-mail: commons-dev-help (AT) jakarta (DOT) apache.org

Re: Using Templates for Mail Message


max 4000 letters.
Your nickname that display:
In order to stop the spam: 8 + 7 =
QUESTION ON "Apache"

EMSDN.COM