Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    cdonts email different agreements based on product purchased

    I have CDonts running for order confirmation.
    I am requesting strAccessories, strDWDT,strNew,strExisting and strDWAemail from a form on another page. Basically letting the CDonts no what agreement to send. However if a user orders 2 things with 2 different agreements it sends last one. If the user orders 2 things that have the same agreement is shows nothings. How can I fix this? Can the line in CDONTS "strBody = dirwaytext" be rewritten to strBody = dirwaytext and accessories

    <%
    strAccessories = Request.form("strAccessories")
    strDWDT = Request.form("strDWDT")
    strNew = Request.form("strNew")
    strExisting = Request.form("strExisting")
    strDWAemail = Request.form("strDWAemail")

    Dim objMsg, strFrom, strBcc, strTo, strSubject, strBody,lngImportance,dirwaytext

    if strDWDT= "yes" then
    dirwaytext = "Show this agreement"
    end if

    if strNew= "yes" then
    dirwaytext = "Show this agreement"
    end if

    if strExisting= "yes" then
    dirwaytext = "Show this agreement"
    end if

    if strDWAemail= "yes" then
    dirwaytext = "Show this agreement"
    end if

    if strAccessories = "yes" then
    accessories = "Show this agreement"
    end if

    strFrom = "sales@yourdomain.com"
    strTo = Trim(Request.Form("strEmail"))
    strBcc = "sales@yourdomain.com"
    strSubject = "Thanks for Shopping With Us"
    strBody = dirwaytext
    lngImportance = 1

    Set objMsg = Server.CreateObject("CDONTS.NewMail")

    objMsg.From = strFrom
    objMsg.To = strTo
    objMsg.Bcc = strBcc
    objMsg.Subject = strSubject
    objMsg.Body = strBody
    objMsg.Importance = lngImportance
    objMsg.Send

    Set objMsg = Nothing

    %>


  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The problem is that you have the same variable for each thing... try instead doing something like:

    if strDWAemail= "yes" then
    dirwaytext = dirwaytext & "Show this agreement"
    end if

    That way it concatenates the body of the email message (which is the variable dirwaytext according to your script) instead of replacing it.

    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #3
    New Coder
    Join Date
    Jul 2002
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ADDING html

    Now, can I get the variable dirwaytext to send html format?


    if strDWDT= "yes" then
    dirwaytext = "Show this agreement"
    end if

  • #4
    New Coder
    Join Date
    Jul 2002
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    That did not work

    I am still getting the same errors. When two products with the same agreement are bought it sends nothing. When two products with different agreements is send the first.?

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Did you concatenate it in all of the If/Then statements?!?

    if strDWDT= "yes" then
    dirwaytext = dirwaytext & "Show this agreement (strDWDT)" & chr(13)
    end if

    if strNew= "yes" then
    dirwaytext = dirwaytext & "Show this agreement (strNew)" & chr(13)
    end if

    if strExisting= "yes" then
    dirwaytext = dirwaytext & "Show this agreement (strExisting)" & chr(13)
    end if

    if strDWAemail= "yes" then
    dirwaytext = dirwaytext & "Show this agreement (strDWAemail)" & chr(13)
    end if

    if strAccessories = "yes" then
    dirwaytext = dirwaytext & "Show this agreement (strAccessories)" & chr(13)
    end if


    And, to send HTML format, you need to add these two lines:

    objMsg.mailFormat = 0 'This is for HTML
    objMsg.bodyFormat = 0 'This is for HTML
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

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