<%@ LANGUAGE = JScript %> <% var EMAIL_TO = "membership@npowerny.org"; var EMAIL_FROM = "\"NPower NY Membership\" "; /* Be sure to use double backslashes between folder names */ var DATA_DIR = "c:\\wwwroot\\NY_V2\\membership\\signup"; var DEBUG = false; var body; var errors = ""; var operation_comment = ""; /* Make sure only humans can submit */ if ( Request.Form("GetCheckNPowerServicesData") == "yes" ) { body = "Date and Time : " + Date().toString() + "\r\n" + "Membership Type : " + Request.Form("MembershipType") + "\r\n\r\n"; if ( Request.Form("MembershipType") != "Individual" ) { body += "Organization Name : " + Server.HTMLEncode(Request.Form("OrgName")) + "\r\n"; if ( Request.Form("OrgAddress2") == "" ) { body += "Address : " + Server.HTMLEncode(Request.Form("OrgAddress1")) + "\r\n"; } else { body += "Address 1 : " + Server.HTMLEncode(Request.Form("OrgAddress1")) + "\r\n" + "Address 2 : " + Server.HTMLEncode(Request.Form("OrgAddress2")) + "\r\n"; } body += "City : " + Server.HTMLEncode(Request.Form("OrgCity")) + "\r\n" + "State : " + Server.HTMLEncode(Request.Form("OrgState")) + "\r\n" + "Zip : " + Server.HTMLEncode(Request.Form("OrgZip")) + "\r\n" + "Main Phone : " + Server.HTMLEncode(Request.Form("OrgPhone")) + "\r\n" + "Main Fax : " + Server.HTMLEncode(Request.Form("OrgFax")) + "\r\n" + "Website Address : " + Server.HTMLEncode(Request.Form("WWW")) + "\r\n"; if ( Request.Form("MembershipType") == "Organization" ) { body += "Employer Tax ID Number : " + Server.HTMLEncode(Request.Form("TaxID")) + "\r\n"; } body += "\r\n"; body += "Membership Contact(MC) : " + Server.HTMLEncode(Request.Form("MCName")) + "\r\n" + "MC Title : " + Server.HTMLEncode(Request.Form("MCJobTitle")) + "\r\n"; if ( Request.Form("MCAddress2") == "" ) { body += "MC Address : " + Server.HTMLEncode(Request.Form("MCAddress1")) + "\r\n"; } else { body += "MC Address 1 : " + Server.HTMLEncode(Request.Form("MCAddress1")) + "\r\n" + "MC Address 2 : " + Server.HTMLEncode(Request.Form("MCAddress2")) + "\r\n"; } body += "MC City : " + Server.HTMLEncode(Request.Form("MCCity")) + "\r\n" + "MC State : " + Server.HTMLEncode(Request.Form("MCState")) + "\r\n" + "MC Zip : " + Server.HTMLEncode(Request.Form("MCZip")) + "\r\n" + "MC Phone : " + Server.HTMLEncode(Request.Form("MCPhone")) + "\r\n" + "MC Fax : " + Server.HTMLEncode(Request.Form("MCFax")) + "\r\n" + "MC E-mail : " + Server.HTMLEncode(Request.Form("MCEmail")) + "\r\n\r\n"; } else /* Individual membership */ { body += "Individual Name : " + Server.HTMLEncode(Request.Form("MCName")) + "\r\n"; if ( Request.Form("MCAddress2") == "" ) { body += "Address : " + Server.HTMLEncode(Request.Form("MCAddress1")) + "\r\n"; } else { body += "Address 1 : " + Server.HTMLEncode(Request.Form("MCAddress1")) + "\r\n" + "Address 2 : " + Server.HTMLEncode(Request.Form("MCAddress2")) + "\r\n"; } body += "City : " + Server.HTMLEncode(Request.Form("MCCity")) + "\r\n" + "State : " + Server.HTMLEncode(Request.Form("MCState")) + "\r\n" + "Zip : " + Server.HTMLEncode(Request.Form("MCZip")) + "\r\n" + "Phone : " + Server.HTMLEncode(Request.Form("MCPhone")) + "\r\n" + "Fax : " + Server.HTMLEncode(Request.Form("MCFax")) + "\r\n" + "E-mail : " + Server.HTMLEncode(Request.Form("MCEmail")) + "\r\n\r\n"; } if ( Request.Form("MembershipType") == "Organization" ) { body += "\r\n"; body += "Executive Director(ED) : " + Server.HTMLEncode(Request.Form("ECName")) + "\r\n"; if ( Request.Form("ECAddress2") == "" ) { body += "ED Address : " + Server.HTMLEncode(Request.Form("ECAddress1")) + "\r\n"; } else { body += "ED Address 1 : " + Server.HTMLEncode(Request.Form("ECAddress1")) + "\r\n" + "ED Address 2 : " + Server.HTMLEncode(Request.Form("ECAddress2")) + "\r\n"; } body += "ED City : " + Server.HTMLEncode(Request.Form("ECCity")) + "\r\n" + "ED State : " + Server.HTMLEncode(Request.Form("ECState")) + "\r\n" + "ED Zip : " + Server.HTMLEncode(Request.Form("ECZip")) + "\r\n" + "ED Phone : " + Server.HTMLEncode(Request.Form("ECPhone")) + "\r\n" + "ED Fax : " + Server.HTMLEncode(Request.Form("ECFax")) + "\r\n" + "ED E-mail : " + Server.HTMLEncode(Request.Form("ECEmail")) + "\r\n\r\n"; body += "\r\n"; body += "Technical Contact(TC) : " + Server.HTMLEncode(Request.Form("TCName")) + "\r\n" + "TC Title : " + Server.HTMLEncode(Request.Form("TCJobTitle")) + "\r\n"; if ( Request.Form("TCAddress2") == "" ) { body += "TC Address : " + Server.HTMLEncode(Request.Form("TCAddress1")) + "\r\n"; } else { body += "TC Address 1 : " + Server.HTMLEncode(Request.Form("TCAddress1")) + "\r\n" + "TC Address 2 : " + Server.HTMLEncode(Request.Form("TCAddress2")) + "\r\n"; } body += "TC City : " + Server.HTMLEncode(Request.Form("TCCity")) + "\r\n" + "TC State : " + Server.HTMLEncode(Request.Form("TCState")) + "\r\n" + "TC Zip : " + Server.HTMLEncode(Request.Form("TCZip")) + "\r\n" + "TC Phone : " + Server.HTMLEncode(Request.Form("TCPhone")) + "\r\n" + "TC Fax : " + Server.HTMLEncode(Request.Form("TCFax")) + "\r\n" + "TC E-mail : " + Server.HTMLEncode(Request.Form("TCEmail")) + "\r\n\r\n"; body += "\r\n"; body += "Mission:\r\n" + Server.HTMLEncode(Request.Form("OrgMission")) + "\r\n\r\n"; if ( Request.Form("Sector") == "Other" ) { body += "Sector/Other : " + Server.HTMLEncode(Request.Form("SectorOther")) + "\r\n"; } else { body += "Sector : " + Server.HTMLEncode(Request.Form("Sector")) + "\r\n"; } body += "Annual Operating Budget: " + Server.HTMLEncode(Request.Form("Budget")) + "\r\n"; } if ( Request.Form("DiscountOffer") != "" ) { body += "Discount Offer : " + Server.HTMLEncode(Request.Form("DiscountOffer")) + "\r\n"; } body += "Payment Type : " + Server.HTMLEncode(Request.Form("Payment")) + "\r\n"; /* if ( Request.Form("Payment") == "Check" ) { body += "Check Amount : $100" + "\r\n"; }*/ //new check code added 3/14/05 if ( Request.Form("Payment") == "Check" ) { body += "Check Amount : " + Server.HTMLEncode(Request.Form("CheckAmount")) + "\r\n"; } else if ( Request.Form("Payment") == "Third Party" ) { body += "Membership Paid By : " + Server.HTMLEncode(Request.Form("PaymentThirdParty")) + "\r\n"; } body += "Publicity Permission : " + Server.HTMLEncode(Request.Form("PublicityPermission")) + "\r\n"; /* Write form input into a text file */ try { var fso, f; op_memo = "creating Scripting.FileSystemObject object"; fso = new ActiveXObject("Scripting.FileSystemObject"); /* Compose new file name from applicant's e-mail address adding .txt to the end of it. Try to see if file exists. If it exists, append a numeric suffix to the file name, and keep trying increasing the number in the suffix until a non-existent file name if formed. */ var file_name = Server.HTMLEncode(Request.Form("MCEmail")); var suffix = ""; var file_index = 1; op_memo = "trying to form a unique file name in folder " + DATA_DIR; while ( fso.FileExists(DATA_DIR + "\\" + file_name + suffix + ".txt") ) { suffix = "-" + file_index.toString(); file_index ++; } file_name += suffix + ".txt"; op_memo = "creating file " + DATA_DIR + "\\" + file_name; f = fso.CreateTextFile(DATA_DIR + "\\" + file_name); op_memo = "writing membership application to file " + DATA_DIR + "\\" + file_name; f.Write(body); op_memo = "closing file " + DATA_DIR + "\\" + file_name; f.Close(); } catch (e) { errors += "Error " + op_memo + "\r\n" + "Error Name : " + e.name + "\r\n" + "Error Number : " + (e.number & 0xffff).toString(16) + "\r\n" + "Error Message : " + e.message + "\r\n" + "Error Description: " + e.description + "\r\n"; } if ( !DEBUG ) { SendMail ( EMAIL_TO, EMAIL_FROM, "Membership Application Form Submitted", "MEMBERSHIP APPLICATION:\r\n\r\n" + body + "\r\n\r\n" + (errors != "" ? "SYSTEM DIAGNOSTICS:\r\n\r\n" + errors : "") ); var heading = "Thank you for enrolling your organization as a member of NPower NY! A copy of your membership " + "application is provided below for your records. We will process your application and be in touch " + "shortly. In the meantime, please don't hesitate to call 212.564.7010 or contact membership@npowerny.org " + "if you have any questions or concerns.\r\n\r\nMEMBERSHIP APPLICATION:\r\n\r\n"; SendMail ( Request.Form("MCEmail"), EMAIL_FROM, "Membership Application Received", heading + body ); } } function SendMail(to,from,subj,body) { var om = Server.CreateObject("CDONTS.NewMail"); om.Send(from,to,subj,body); om = null; } %> NPower NY - Membership Confirmation
Skip to Navigation | Skip to Content

<% if (DEBUG) { Response.Write("
\r\n" + body + "
\r\n"); if ( errors != "" ) { Response.Write("
\r\n" + errors + "\r\n
\r\n"); } } %>

Thank you for enrolling your organization as a member of NPower NY!

You should receive an e-mail with a copy of your your membership application. We will process your application and be in touch shortly. In the meantime, please don't hesitate to call 212.564.7010 or contact Membership@NPowerNY.org if you have any questions or concerns.