<%@LANGUAGE="VBSCRIPT"%> <% '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Spd E-Letter v4 ' © 2001, 2002 PensaWorks, inc. ' For help with this program, please visit http://www.pensaworks.com '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Dim Access : Access = "Broadcast" Dim Nav3 : Nav3 = "5" %> <% on error goto 0 if (isnumeric(request("msgID")) and request("msgID") <> "") then msgID = CInt(request("msgID")) else msgID = 0 if (msgID = 0) then response.redirect "newsletter_step1.asp?msg=1" set getNewsletter = server.createobject("ADODB.Recordset") getNewsletter.activeconnection = mlConn getNewsletter.source = "SELECT ML_Broadcast.ListID AS msgListID, * FROM ML_Broadcast INNER JOIN ML_Lists ON ML_Broadcast.ListID = ML_Lists.ListID WHERE ML_Broadcast.MessageID = " & msgID getNewsletter.cursortype = 3 getNewsletter.open() if (getNewsletter.EOF) then response.redirect "message.asp?msg=20" msgSubject = getNewsletter("Subject") msgListname = getNewsletter("ListName") msgSource = getNewsletter("msgSource") msgFormat = getNewsletter("msgFormat") msgTemplate = getNewsletter("msgIncludeTemplateText") msgText = getNewsletter("TextMessage") msgSourceFile = getNewsletter("msgSourceFileText") msgSourceURL = getNewsletter("msgSourceURLText") msgSourceRun = getNewsletter("msgSourceTextTimes") msgSourceFileNew = "" if (msgSourceFile <> "") then msgSourceUse = 1 else msgSourceUse = 2 if lcase(request("action")) = "go" then msgTemplate = request("msgTemplate") msgText = trim(request("msgText")) msgSourceFileNew = trim(request("msgSourceFileNew")) msgSourceUse = request("msgSourceUse") msgSourceURL = trim(request("msgSourceURL")) msgSourceRun = request("msgSourceRun") msgFilePath = trim(request("msgFilePath")) select case msgSource ' case 1 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' case 1 if msgText = "" then msg = 1 else mlConn.Execute("UPDATE ML_Broadcast SET TextMessage = '" & replace(msgText, "'", "''") & "', msgIncludeTemplateText = " & msgTemplate & " WHERE MessageID = " & msgID) redir = funcRedirect() end if ' case 2 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' case 2 if cstr(msgSourceUse) = "1" then if NOT doesFileExist(msgSourceFile) then msg = 3 else doIt = updateRec(msgSourceFile) end if end if if cstr(msgSourceUse) = "2" then if NOT doesFileExist(msgSourceFileNew) then msg = 4 else doIt = updateRec(msgSourceFileNew) end if end if function updateRec(msgFile) mlConn.Execute("UPDATE ML_Broadcast SET msgSourceFileText = '" & replace(msgFile, "'", "''") & "', msgIncludeTemplateText = " & msgTemplate & " WHERE MessageID = " & msgID) redir = funcRedirect() end function ' case 3 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' case 3 if msgSourceURL = "" then msg = 1 else if NOT (lcase(left(msgSourceURL, 7)) = "http://" or lcase(left(msgSourceURL, 8)) = "https://" or lcase(left(msgSourceURL, 6)) = "ftp://") then msg = 5 else if (instr(1, msgSourceURL, "?") <> 0) then strURL = msgSourceURL & "&subID=0&Format=Text&Test=true" else strURL = msgSourceURL & "?&subID=0&Format=Text&Test=true" urlTest = getHTML(strURL, bitResponse) if NOT bitResponse then msg = 2 else ' update & redirect mlConn.Execute("UPDATE ML_Broadcast SET msgSourceURLText = '" & replace(msgSourceURL, "'", "''") & "', msgIncludeTemplateText = " & msgTemplate & ", msgSourceTextTimes = " & msgSourceRun & " WHERE MessageID = " & msgID) redir = funcRedirect() end if end if end if ' end case '''''''''''''''''''''''''''''''''''''''''''''''''''''''''' end select end if function funcRedirect() if lcase(request("Submit")) = "save & refresh" then response.redirect "newsletter_step4.asp?msgID=" & msgID else response.redirect "newsletter_step5.asp?msgID=" & msgID end if end function if (msgFormat = 3) then response.redirect "newsletter_step5.asp?msgID=" & msgID if (msgTemplate <> 1 AND msgTemplate <> 2) then msgTemplate = 1 %> <%=ListName%> - Spd E-Letter Administration

Create Newsletter - Step 4

Click here for a list of standard customation/mail merge tags
New to URL Tracking? Click Here
New to Content Snippets? Click Here

With the Spd E-Letter, you can use a mail merge with your own stored data. Click here for a list of those tags as well as more information.

 

<% if msg = 1 then %>

Missing Information. Please complete all fields.

<% elseif msg = 2 then %>

Invalid URL. No information could be retreived from the specified URL.

<% elseif msg = 3 then %>

Existing file is invalid. Please choose a new one.

<% elseif msg = 4 then %>

Please choose a valid new file.

<% elseif msg = 5 then %>

Invalid URL. Must begin with "http://", "https://" or "ftp://">

<% end if %>
<% if msgSource = 2 then %> <% elseif msgSource = 3 then %> <% else %> <% end if %>
Text Newsletter Data
Subject:
<%=msgSubject%>
Newsletter Source:
<% if msgSource = 2 then %> From File <% elseif msgSource = 3 then %> Executed Page <% else %> Entered Data <% end if %>
To List:
<%=msgListname%>
Select New File:
<% returnFile = "" getIt = listFiles("txt,html,htm", returnFile, baseDirectory) if returnFile <> "" then msgSourceFileNew = returnFile end if %>
Current File:
<% if msgSourceFile = "" then useCurrent = false msgSourceUse = 2 %> None <% else useCurrent = true %> <%=msgSourceFile%> <% end if %>
New File:
<% if msgSourceFileNew = "" then %> None <% else %> <%=msgSourceFileNew%> <% end if %>
Use:
<% if useCurrent then %> > Current File
<% end if %> > New File
URL:
Execute:
> Execute once at load time
> Execute for each subscriber
Newsletter Body:
Template:
> Yes, include the header and footer for this list
> No, do not include the header and footer for this list

Please be sure to save your data often.