You might want to try something like velocity so you can store the text of
the e-mail as a template and use velocity to insert the dynamic content.

If there are really only a few simple fields, I would store the text in the
database or an xml file and then use a simple string replace routine to
replace tags like {ORDER_ID} and {USER_NAME} with the order id and user name
before passing that message to the mailer.

-Rob


-----Original Message-----
From: Matt Bathje [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 11, 2004 11:03 AM
To: strutslist
Subject: [OT] Sending email from struts

Hi all.

This is kind of off topic as it is not really struts related, but somebody
here would probably have the answer.

We have our application sending emails to users at some points and it is
working fine. The problem is that we have the email message hardcoded into
the Java, which we would like to avoid either by storing the message in
application.properties or our database. This would be easy, except all of
the messages contain user-specific information like their name or phone
number or order id or something like that.

Anybody have any ideas (or links to programs!) that can read in an email,
replace the information it needs to from the db, and send that to the user.

I could obviously write something myself to do it, but wouldn't want to
reinvent the wheel.

Turns out this is hard to search for too - email is not a search term that
makes things easy.

Thanks,
Matt Bathje


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to