<% '************************************************************************************ '* * '* MODIFICATION TO THIS SCRIPT OR ANY FILES INCLUDED WITH * '* ONEWORLDSTOREFRONT IS DONE AT YOUR OWN RISK! * '* Product : OneWorldStoreFront * '* Copyright: Copyright (C) 2004 OneWorldStoreFront.Com * '* Registration Number: 1024507 * '* http://strategis.ic.gc.ca/ * '* * '************************************************************************************ Dim sFriendComments, sName, sEmail, sFriendName, sFriendEmail, sIdProduct '************************************************************************************ '* * '* * '* * '************************************************************************************ Sub ActionSubroutine() %>
<%=LANG_DT( "SENDTOFRIEND_HEAD", "Email a Friend this Product" )%>
<% Dim sEmailResponse, sFullLetter, sAction, sError, sSuccess sIdProduct = Trim(Request("sIdProduct")) sAction = Trim(Request("sAction")) sError = "" sName = Trim(Request("sName")) sEmail = Trim(Request("sEmail")) sFriendName = Trim(Request("sFriendName")) sFriendEmail = Trim(Request("sFriendEmail")) sFriendComments = Trim(Request("sFriendComments")) If ( sAction = "SendToFriend" ) Then If ( sName = "" ) Then sError = LANG_DT( "SENDTOFRIEND_ENTERNAME", "Please enter your name." ) End If If ( sEmail = "" ) Then sError = sError & "
" & LANG_DT( "SENDTOFRIEND_ENTEREMAIL", "Please enter your email address." ) End If If ( sFriendName = "" ) Then sError = sError & "
" & LANG_DT( "SENDTOFRIEND_ENTERFRIENDNAME", "Please enter your friends name." ) End If If ( sFriendEmail = "" ) Then sError = sError & "
" & LANG_DT( "SENDTOFRIEND_ENTERFRIENDEMAIL", "Please enter your friends email address." ) End If If ( sError = "" ) Then If ( InStr(sEmail, "@") < InStrRev(sEmail, ".") ) And ( InStr(sEmail, "@") > 0 ) Then sFullLetter = LANG_DT( "SENDTOFRIEND_EMAIL", "" ) sFullLetter = Replace(sFullLetter, "#FRIENDNAME#", sFriendName) sFullLetter = Replace(sFullLetter, "#COMMENTS#", sFriendComments) sFullLetter = Replace(sFullLetter, "#COMPANY#", sOWCompany) sFullLetter = Replace(sFullLetter, "#URL#", sOWStoreUrlSSL) sFullLetter = Replace(sFullLetter, "#NAME#", sName) sFullLetter = Replace(sFullLetter, "1:", sIdProduct) 'Dear, #FRIENDNAME# ' '#COMMENTS# ' 'Visit the #COMPANY# store for all the information about this product. Copy and paste this link into your browser: '#URL#owProductDetail.asp?idproduct=1: ' 'Thanks, '#NAME# ' '#COMPANY# 'Powered By OneWorldStoreFront sSubject = LANG_DT( "SENDTOFRIEND_SMALLEMAILSUBJECT", "Product Recommendation" ) sEmailResponse = sendMail(sName, sEmail, sFriendEmail, sSubject, sFullLetter) if ( sEmailResponse ) then sSuccess = LANG_DT( "SENDTOFRIEND_SENTSUCCESSFULLY", "Your message has been sent to your friend successfully!" ) else sError = LANG_DT( "SENDTOFRIEND_ERRORSENDING", "Unable to send message!
Please contact the administrator as soon as possible." ) & "
Error: " & sEmailResponse end if Else sError = LANG_DT( "SENDTOFRIEND_INVALIDEMAIL", "Unrecognizable email address. Please enter another email address." ) & "
" & sEmail & " - " & LANG_DT( "SENDTOFRIEND_INVALIDEMAIL2", "is Not a Valid Email Address." ) End If End If End If If ( sError <> "" ) And ( sAction <> "" ) Then Call owMessage(sError, C_ERROR) Call WriteForm() End If If ( sSuccess <> "" ) Then Call owMessage(sSuccess, C_SUCCESS) End If If ( sAction = "" ) Then Call WriteForm() End If %>
<% End Sub '************************************************************************************ '************************************************************************************ '* * '* This is the function to write out the form. * '* * '************************************************************************************ Sub WriteForm() If ( sIdProduct <> "" ) Then sSQLText = "SELECT * FROM Products WHERE idProduct = " & sIdProduct Call DB_getFromDatabase(sSQLText, rsStoreData, "") If ( NOT rsStoreData.EOF ) Then sDescription = rsStoreData("description") sPrice = rsStoreData("price") sBtoBPrice = rsStoreData("bToBPrice") slistprice = rsStoreData("listprice") sSmallImageUrl = rsStoreData("smallImageUrl") sStock = rsStoreData("stock") sVisits = rsStoreData("visits") sNumRanking = rsStoreData("NumRanking") sRanking = rsStoreData("Ranking") sIDSupplier = rsStoreData("idSupplier") sSKU = rsStoreData("SKU") sShortDesc = rsStoreData("ShortDesc") Call TEMPLATE_ProductListingDisplay( sShortDesc, sSKU, sIDSupplier, sSmallImageUrl, sDescription, slistprice, sPrice, sBtoBPrice, sStock, sVisits, sIdProduct, idCategory, sNumRanking, sRanking ) End If Call DB_closeRecordset(rsStoreData) End If If ( iLoginAccountUnq <> "" ) Then sName = ACCNT_ReturnADV("OW_CUSTFNAME", "V", iLoginAccountUnq, C_OVERRIDE_ADV) & " " & ACCNT_ReturnADV("OW_CUSTLNAME", "V", iLoginAccountUnq, C_OVERRIDE_ADV) sEmail = ACCNT_ReturnADV("OW_CUSTEMAIL", "V", iLoginAccountUnq, C_OVERRIDE_ADV) End If If ( sFriendComments = "" ) Then sFriendComments = LANG_DT( "SENDTOFRIEND_SMALLEMAIL", "Your friend would like to tell you about this great product!" ) End If %>
*<%=LANG_DT( "SENDTOFRIEND_YOURNAME", "Your Name" )%>:
*<%=LANG_DT( "SENDTOFRIEND_YOUREMAIL", "Your Email" )%>:
*<%=LANG_DT( "SENDTOFRIEND_FRIENDNAME", "Your Friends Name" )%>:
*<%=LANG_DT( "SENDTOFRIEND_FRIENDEMAIL", "Your Friends Email" )%>:
<%=LANG_DT( "SENDTOFRIEND_YOURCOMMENTS", "Additional comments you would like to include in the email sent your friend" )%>:
* <%=LANG_DT( "SENDTOFRIEND_REQUIRED", "Required fields" )%>
<% End Sub '************************************************************************************ %>