Apologies if the title is a bit difficult to understand, but I wasn't sure what else to put.
heres, my issue...I have several pages in my site that send emails...a couple of these pages send what is effectively the same email and use something like
then, as each record loops round, the email is built the with variables pulled from the database to replace the name etc.Code:get first recipient email_contents = "Hello " & rs1.Fields.Item("username").Value & "<br><br>" email_contents = email_contents & "Please be aware that the " & rs1.Fields.Item("eventname").Value & " is going to be cancelled" send email loop round to get next recipient
The issue is that if I want to change the contents of the email, I have to edit the file itself. I would rather have this stored in a DB and then it would be easier to change, and for places where the same email is used I could just call the particular email from the database and wouldn't have to edit it in two places if I wanted to change it.
The problem I have, is how can I store the contents I want AND have the correct variables parsed as the email is sent? what happens of course is that the email is sent with the 'variables' as text so the person receives an email with code in it, because it isn't recognised as script and therefore parsed with the correct variables in it. I need to know how to escape the code so that it gets parsed correctly when the email is sent.
thanks in advance