Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues > ColdFusion

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-17-2007, 03:51 PM   PM User | #1
philscheffer
New to the CF scene

 
Join Date: Mar 2007
Location: Vermont
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
philscheffer is an unknown quantity at this point
Different automated emails send with same email information

Problem:
This file is for automated email reminders. The emails are called by "template." It loops through the active emails. For each email it pulls a different set of email addressed with "getAddress." Here is the part I haven't been able to figure out; On screen (see image below) it appears that the emails pulled the proper data, and email lists. The emails right now are all directed at me, and I even get the proper number, including the correct "to" email addresses, of emails BUT the emails all have the email info (from, subject, body) as the first email in the loop.

Below is the code (from, to, etc. are hard coded for the time being), and a screen shot of the results (browser side.)

Any suggestions would be greatly appreciated! Thanks!


Code:
<cfloop query="template">
<cfset getAddress=getNonActivatedGreenKeys(#template.accountList#, "", "", #template.issuedDays#)>
<cfif debugmode>
	<cfmail
		query="getAddress"
		server="#BG_MAIL_SERVER#"
		from="#template.from#" 
		to=""
		bcc=""
		replyto=""
		subject="#template.subject#" 
		spoolEnable="yes">#getAddress.issuedToEmail# #template.body#</cfmail>
<cfelse>
	<cfmail
		query="getAddress"
		server="#BG_MAIL_SERVER#"
		from="#template.from#" 
		to=""
		bcc=""
		replyto=""
		subject="#template.subject#" 
		spoolEnable="yes">#template.body#</cfmail>
</cfif><!--- closes debugmode if --->
<div style="background-color: #FFFFFF; border: 2px solid #000000; padding: 10px; margin-bottom:15px;">
<p>
<b>Email Sent to <cfoutput>#getAddress.recordCount#</cfoutput> Recipients</b><br />
<cfoutput>
Name: #template.name#<br />
From: #template.from#<br />
Subject: #template.subject#<br />
Body: #template.body#<br />
</cfoutput>
</p>
</div>
</cfloop><!--- closes template query --->

philscheffer is offline   Reply With Quote
Old 12-17-2007, 07:00 PM   PM User | #2
philscheffer
New to the CF scene

 
Join Date: Mar 2007
Location: Vermont
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
philscheffer is an unknown quantity at this point
Thumbs up fixed...

My boss was able to figure it out (yey bosses!) There is a bug in CF 7 that causes the inside loop (<cfmail query="">) to not update the next time through the outside loop. The outside loop worked fine, which is why on screen, it appeared fine.

To fix it I had to change #template.body# to #template.body[template.currentrow]# anywhere template was being used inside the cfmail tags, setting up an array to pull the correct data from the template loop.

Cheers!
Phil
__________________
"everything should be made as simple as possible, but not simpler." - albert einstein
philscheffer is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:15 AM.


Advertisement
Log in to turn off these ads.