Hope someone can give me some advice. I am just starting to design a new application and one part of it is causing me some problems.
I want to generate and send an email from within the application. The bones of that I have sorted out. However, I need to generate the text of the email from some text and some variables and I want to save the standard templates in a table.
To explain, I will have a table (tblMessages) with two fields – TableName and TableText. This will allow the setup of multiple templates to use in different situations. A tblMessages record could look something like this:
TableName = Get details
TableText = ..
Thankyou for showing an interest in the opportunity [opportunity] for [organisation]
Please send us additional details about yourself blah blah.
The email will be generated and sent using a button on a form. The form will contain the necessary data to use (eg emailaddress, firstname, opportunity and organisation.
So my question is, is it possible to create the tblMessage data in such a way that it contains within it the variable placeholders. I know that I could assemble the whole text within the code of the button, but I really want one place to define the mail template text etc.
Any suggestions would be welcome.