Library tutorials & articles

Creating a Newsletter system

Introduction

This tutorials will show you how to create a fully automated system to allow visitors to subscribe and unsubscribe to your newsletter. It also shows the administration panel to mass mail all members. Let's Begin:

Here's what's involved.
1) Create the database
2) Create a page for people to sign up.
3) Create a page to unsubscribe.
4) Create a page to send newsletter.

First, lets create the database. Create a table called: Newsletter. Next, create the following fields.

Field Name Field Type
MemberID Autonumber
Name Text
Email Text
EmailType Number

Once you have created the database, create a DSN pointing to the database by going to Data Sources (ODBC) in Administrative Tools on Windows. Now we need to create the actual pages...

Comments

  1. 23 May 2006 at 16:00

    Try using 'GTE' as opposed to 'GTI'.

    Its supposed to mean Greater Than or Equal to.

  2. 13 May 2006 at 16:15

    Hi, could anyone help me with this? Im getting an error on the unsubscribe page to do with the GTI line. Its pretty new to me and im not even sure what this line means!!!

    Element RECORDCOUNT is undefined in UNSUBSCRIBE.

     
    The error occurred in C:\Inetpub\wwwroot\sevenvinylsrecordstore\Unsubscribe.cfm: line 137

    135 : 
    136 : <CFOUTPUT>
    137 : <CFIF Unsubscribe.recordcount GTE 1>
    138 : Thank you #Name#,
    139 : Your email address [#Email#] Has been removed from our mailing list. You'll 

    I tried it with and  without the"" but still get the same error???

     

    Anyone willing to help out?

    Thanks Pete

  3. 22 Jan 2003 at 14:24

    I'm new to the web scene but need this script to work. Please let me know how I put it in. Is it in the body. Are they seperate pages?
    Can you make this dummy proof for a beginner like me.


    Thanks
    Please e-mail me asap if you can

  4. 14 Jan 2003 at 04:00
    Hi i am new in creating newsletters and i would like to ask you.This code you submit enters in the <BODY></BODY> section.I tried to put it there but in the PREVIEW i see nothiing but plain text.
    Please explain where this code should be put.
    Thank you in advance.

    P.S Should i create an html page with plain text forms to enter the code behind???
  5. 11 Jul 2002 at 00:13

    If you have notice, the sample code here does not have a field 'message' in the database. Maybe you can add in the field for 'message', or you can have a form before that to input all the email message, and then change the 'GETMEMBERS.message' to 'form.message' ... hope this help.

  6. 11 Jul 2002 at 00:08

    Great job~!


    I tried change a bit on the code, thought you maybe interested:


    <CFIF Form.EmailType EQ "1">
     <CFSET mailType = "HTML">
    <CFELSE>
     <CFSET mailType = "Text">
    </CFIF>


    <CFQUERY NAME="GetMembers" DATASOURCE="Your DSN">
    Select *
    From Newsletter
    WHERE EmailType = #form.EmailType#
    Order By MemberID
    </CFQUERY>


    <!--- Determine if email going out will be in HTML format or not --->


    <CFMAIL To="#GetMembers.Email#"
    From="newsletter@menofvisionent.com"
    Subject="This Week's Newsletter!"
    Type="#mailType#">

    GetMembers.Message


    Sent: #DateFormat(Now(), 'ddd. mmmm dd, yyyy')#
    to Unsubcribe visit: http://www.menofvisionent.com/unsubscribe.cfm
    </CFMAIL>


  7. 27 Jun 2002 at 17:12

    I'm getting this error when I try to input text for the "Message" form field... anyone know why it's doing this?


    Error resolving parameter GETMEMBERS.MESSAGE


    The column MESSAGE is not present in the query named GETMEMBERS. It is likely that you have misspelled the name of the column.


    The error occurred while processing an element with a general identifier of (#GetMembers.Message#), occupying document position (41:1) to (41:20).

  8. 01 Jan 1999 at 00:00

    This thread is for discussions of Creating a Newsletter system.

Leave a comment

Sign in or Join us (it's free).

Pablo Varando I've been around computers ever since I could remember, The first time I toyed around with a computer, I was about 3 years old. I ran my own BBS service in Miami from age 7 to 13 and I found it ver...

Related discussion

Related podcasts

  • Crawlable Flash, Concurrent Python, Smart Robots.txt and more

    Mixed topics today Adobe works with Google, Yahoo and others to make Flash apps crawlable. Reddit.com open sources their codebase "Smart" robots.txt files - do you use them? Bruce Eckel article on concurrent Python with Twisted Railo - open source ColdFusion Cognifty - new PHP framework...

Events coming up

  • Feb 17

    Andrew Powell on How I Learned to Stop Worrying and Love UX

    Atlanta, United States

    Come on out this month to hear Atlanta's own Andrew Powell talk on "How I Learned to Stop Worrying and Love UX"Andrew Powell has been architecting and developing web applications for over 10 years using ColdFusion, Flex, AJAX, and Java. His background includes experience running IT Departments for firms in the executive search and aviation consulting fields. Currently, Andrew is a Principal Architect at Universal Mind specializing in ColdFusion, Java, & Flex.

Want to stay in touch with what's going on? Follow us on twitter!