Emailing a reminderI wanted to email the prospective member, and give the option in the email to quickly confirm his membership, so I used the same code as in the original sign up page to include the link to C.asp.(Of course, it's possible that I should have moved this "duplicate code" into an SSI, but I judged that the duplication was minimal) if ( dDate.getDate ( ) == nDate )
{
var sEmail = '' + oRecordSet ( 1 );
var sName = '' + oRecordSet ( 2 );
var sDate = FormatDateDMY ( dDate );
// send Email with our generic function
var sBody = 'Dear ' + sName + '\n\n';
sBody += 'Today is your last chance to confirm your membership on CoverYourASP.com!\n\n';
sBody += 'Membership accounts have to be confirmed via email - and unconfirmed accounts are only kept for 10 days. Since you registered on ' + sDate + ' your membership account will be deleted tomorrow unless you confirm your account.\n\n';
sBody += 'To confirm your CoverYourASP membership account please click on the link below, or copy and paste the entire URL into your browser.\n\n';
sBody += 'IMPORTANT: if the link below is wrapped onto two lines by your email software please copy from the "http" to the end of the number on the second line, then paste that into your browser.\n\n';
sBody += 'http://CoverYourASP.com/C.asp?a=a&e=' + sEmail + '&i=' + nID + '\n\n';
sBody += 'I hope to hear back from you soon!\n\n';
sBody += 'Member Services\n';
sBody += 'MemberServices@CoverYourASP.com\n';
sBody += 'http://CoverYourASP.com/';
if ( -1 == sServer.indexOf ( 'localhost' ) )
SendEmail ( 'MemberServices@' + sHostDomain, sEmail, '', 'Final Notice: Lapsing CoverYourASP membership', sBody );
}
|
Fairly straight-forward code I hope you'll agree. Get the email and name of the member from the recordset, then make up the body of the email in the sBody variable. Two things to note: The use of \n as a linefeed in JavaScript. How I don't send the email if running from localhost, i.e. my development machine! The sServer variable is set globally in Init( ), and contains the value of Request.ServerVariables ( 'SERVER_NAME' ). Part 5: Deleting unconfirmed members... |