ASP.NET 2 - how can I embed variables in an email body text file

M

Mark1249

Hello,

I am using ASP.NET 2 and using the CreateUserWizard I am wanting an
email to go out to the new user informing them of their account details
etc...

I have a BodyFileName in the MailDefinition section of the
CreateUserWizard component and have that currently pointing to a simple
text file where I want to embed the account detail variables and email
text.

I have read on a website that you can use embedded variables, such as
<% UserName %> which obviously displays the username and which I have
had working, but I can't find anything anywhere else that tells me what
the other default available variables are or ideally, how I can define
and add my own.

There are ways around this by dynamically creating the email text in
code, but I would really like to use the embeded variables as I think
this will be easier in the long run.

Any help would be much appreciated.

Many thanks in advance.

Cheers
Mark...
 
M

Mark1249

Hi Clinton,

Thank you very much for your response.

The thing I was talking about in my original email were not code render
blocks (unless I am wong, which could be very likely), they are
actually tags that insert data into the email text (very similar to a
Word Mail Merge etc...).

In asp.net 2 I have created a site with Forms authentication which
includes profiles for capturing First Name and Last Name etc.., and
want to customise the standard emails that you can set to be sent once
a new user registers or resets their password etc... and I read
somwhere that you can customise this email text, however with something
like the password recovery email it needs to be able to send the user
their new password along with the customised text. I have managed to
do this using the tag "<% Password %>" and in the new user email I can
send the new user a reminder of what their password is by including the
tag "<% Username %>". Manybe these are considered code blocks, but my
understanding is that code blocks are for use in HTML and start with
"<%=" rather than "<%" rather than for use in a text file for the
purpose of customising the emails.

My question is that I am wondering what other "<% xxxx %>" tags are
available and also how I can use these tags to put in some of my
profile data such as First Name and Last Name?

Any help would be much apreciated as I could write a customised email
compiler, but I really want to use as much of the in-built asp.net
tools as I can.

Looking forward to your response.

Regards
Mark...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,737
Latest member
Georgeengab

Latest Threads

Top