Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Small Newsletter Assistance 1

Status
Not open for further replies.

TamedTech

IS-IT--Management
May 3, 2005
998
0
0
GB
Afternnon Chaps,

I've got the following newsletter script so far that lets me mass mail my subscibers with ease. Sorry for the sloppy code but its still in development so i'm still ironing out creases.

What i'm looking for assistance with is including the Persons E-Mail address in a link at the bottom of the mail, this way i could have somthing like this.

Code:
<a href="[URL unfurl="true"]http://www.mydomain.com/news/unscubscribe.cfm?email=#Users[/URL] EMail!#>Click Here to Unsubscribe!</a>

I have unsubscribe.cfm just deleteing records according to the e-mail defined in the URL.

The user can then click the link and it will imediatly un-subscribe them from our listings without too much hastle.

The problem i'm having is getting it to recognise which user e-mail it should be putting at the foot of the mail as it's sending to multiple recipients.

Any ideas on how to do this?

Thanks,

Rob

Code:
<!--- Script for sending monthly newsletter --->

<!--- Query for News Items --->
<CFQUERY NAME="news_items" DATASOURCE="managem6">
SELECT * FROM master_page_content WHERE news_item = "yes"
</CFQUERY>

<!--- Query for promotion Items --->
<CFQUERY NAME="promotion_items" DATASOURCE="managem6">
SELECT * FROM product_list WHERE promotion = "yes"
</CFQUERY>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>

<!--- Query that obtains content for the newletter --->
<CFIF IsDefined("intro")>
<CFQUERY NAME="GetMembers" DATASOURCE="managem6">
SELECT * FROM 4windsnews
ORDER BY member_id
</CFQUERY>

<!--- CFMAIL statements --->
<CFMAIL query="GetMembers" To="#GetMembers.Email#" From="The Management Training Network<newsletter@mydomain.com>" Subject="This Month's Newsletter!" type="HTML">

<!--- change the reply address --->
<cfmailParam name="Reply-To" value="doNotReplyToThisEmail@mydomain.com">

<!--- sets the priority with a nice shiney red flag --->
<cfmailParam name="X-Priority" value="1">

<!--- CFMAILPART this is for the text based version of the e-mail --->
<cfmailpart type="text">
Monthly TEXT News
This is the text version for those viewers that dont support HTML.
</cfmailpart>

<!--- CFMAILPART this is for the text based version of the e-mail --->
<cfmailpart type="html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<h2>This is a the Monthly HMTL News</h2>
<p>#form.intro#</p>

<h3>#form.header1#</h3>
<p>#form.article1#</p>

<h3>#form.header2#</h3>
<p>#form.article2#</p>

<h3>#form.header3#</h3>
<p>#form.article3#</p>

<!--- CFIF on whether to include Automated News Items --->
<CFIF IsDefined("display_news")>
<CFLOOP QUERY="news_items">
<h3>#news_items.page_title#</h3>
<p>#LEFT(news_items.page_content, 150)#...</p>
</CFLOOP>
<cfelse>
<p>No News</p>
</cfif>

<!--- CFIF on whether to include Automated Promotions Items --->
<CFIF IsDefined("display_promotion")>
<CFLOOP QUERY="promotion_items">
<h3>#promotion_items.product_name#</h3>
<p>#promotion_items.product_price#</p>
</CFLOOP>
<cfelse>
<p>No Promotions</p>
</cfif>

</body>
</html>
</cfmailpart>


</CFMAIL>
<!--- Page content for after mail has been sent --->

<div id="body-content">
<p>Thanks for sending that Mail</p>
</div>


<!--- Form for entering content to be mailed --->
<CFELSE>
    <form action="newsletter2.cfm" method="post">
        News Letter Introduction: <Textarea Name="intro"></textarea><BR>
        Article Header 1: <Textarea Name="header1"></textarea><BR>
        Article Body 1: <Textarea Name="article1"></textarea><BR>
		Article Header 2: <Textarea Name="header2"></textarea><BR>
        Article Body 2: <Textarea Name="article2"></textarea><BR>
		Article Header 3: <Textarea Name="header3"></textarea><BR>
        Article Body 3: <Textarea Name="article3"></textarea><BR>
		Include News?: <input name="display_news" type="checkbox"><BR>
		Include Promotions?: <input name="display_promotion" type="checkbox"><BR>
		<input type="Submit" Value="Mail Newsletter">
		</FORM>
</CFIF>

</body>
</html>
 
Of course ... I think i've been staring are this code for a little too long lol,

Thanks for that buddy.

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top