Results 1 to 6 of 6

Thread: [RESOLVED] Creating and populating email templates

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    589

    Resolved [RESOLVED] Creating and populating email templates

    I have a page that is called from loads of different pages that basically sends emails. It has text boxes for Subject, From Address etc. and a textbox like the one I am typing in now (on this site) which allows users to format a html message.

    I need to develop the functionality by providing email templates for the message.

    So, the template text (which will be stored and retrieved from a database) might contain:

    Dear .......

    Thanks for attending the meeting.

    Kind regards
    .......


    Where the ...... are, I would want to fill in the name of the person who is going to receive the email and the name of the person sending it.

    So, I'm on the page - I've retrieved the text for the message from the database - I have SendersName and ReceiversName sitting there in variables - how do I get them in the text in the right place?

    I was thinking I could make the template text look like this:-

    Dear [ReceiversName]

    Thanks for attending the meeting.

    Kind regards
    [SendersName]


    and then, on the page, just Replace the various 'tags'. Is this a good idea?

    Thanks for any suggestions.

  2. #2
    Frenzied Member avrail's Avatar
    Join Date
    Mar 2006
    Location
    Egypt, Cairo
    Posts
    1,221

    Re: Creating and populating email templates

    hay,
    i believe this will help
    http://www.aspheute.com/english/20000918.asp
    You Don't Have to Rate Me.
    I'm Not a Civilized Man I'm the Civilization it self
    White or Black, Living or Dieing and 0 or 1 that's MY life
    iam an Object in Object Oriented Life
    my blog : http://refateid.blogspot.com/
    twitter :@avrail
    010011000111010101110110001000000100110101111001001000000101000001100011

  3. #3
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Re: Creating and populating email templates

    @Webskater, what you have proposed is actually a good idea, one that I have used in a few projects in the past.

    If you want more sophistication, you could explore the XML/XSLT alternative, but it might be an overkill. For a simple template-based email app, inserting placeholders in the template and then replacing them with the actual values should work best.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Creating and populating email templates

    Webskater,

    You can find an example here:

    http://dotnettricks.com/blogs/roberh.../05/12/57.aspx

    Hope that helps!

    Gary

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    589

    Re: Creating and populating email templates

    Thanks for all the replies. To be honest I thought it was a bit of a daft question, but it wasn't. I didn't know anything about what is shown in the link Gary provided - and that is just what I was after.

    Thanks again.

  6. #6
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: [RESOLVED] Creating and populating email templates

    Not a problem at all, happy to help!!

    Let us know if you have any problems.

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width