Skip to main content
Inspiring
October 10, 2006
Question

'mail merge' with html

  • October 10, 2006
  • 2 replies
  • 633 views
I am attempting to send an html based bulk email that I want to merge with a
database to personally address each email to each recipent. The html
newsletter is saved to a database and is looped to mail.

How can I include the mail merged element (name) into the html and have it
merge properly when the mail is sent?

I keep getting #name# in the emails.

Thanks!


This topic has been closed for replies.

2 replies

Inspiring
October 10, 2006
The website is in CF, but the newsletter is in HTML and saved to the
database. I need it to merge, with the coldfusion which is sending the
emails, to produce the name and the html email that is inserted.

Here is what I have. The campaign.html is an html email that I need to merge
with the database to include the name.
Just need to figure how to put the #name# into the HTML so coldfusion first
evaluates the html and then the name inside of it.

<cfloop query="mailist">
<cfmail from="#campaign.emailfrom#" to="#mailist.email#"
failto="bounce@avemarialaw.edu" replyto="#campaign.emailreply#"
server="****" subject="#campaign.subject#">
<cfoutput>#campaign.html#<br /><br />
Your name has been provided to Ave Maria School of Law by the Law School
Admissions Council Candidate Referral Service.<br />If you wish not to
receive future communications, <a
href=" http://www.avemarialaw.edu/mailings/optout.cfm?email=#mailist.email#&name=#mailist.name#">please
click here.</a></cfoutput>
</cfmail>
</cfloop>


Inspiring
October 10, 2006
You could modify the HTML email to insert a distinctive placeholder for the name. For example:

Dear [[NAME]]:

Then use Replace() to replace the string [[NAME]] with the appropriate name in campaign.html (which is just a long string). Then send the revised text as the body of your email.

October 10, 2006
I presume you are using a ColdFusion page. You need <CFOUTPUT>#name#</CFOUTPUT>