We are having a problem when ColdFusion replaces two variables inside a CFMAIL tag. If there is no normal text between two variable substitutions, ColdFusion drops the carriage return line feeds that format the text into paragraphs.
I have attached source code which has three examples in it.
1) demonstration of the problem
2) work around by using a period after the first variable
3) replacing the two juxtaposed variables with a work around variable definition
Source Code:
I have attached source code which has three examples in it.
1) demonstration of the problem
2) work around by using a period after the first variable
3) replacing the two juxtaposed variables with a work around variable definition
Source Code:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>CFMAIL Test</TITLE>
</HEAD>
<BODY>
<!--- setup some memory variables for this test. Use instead of normal FORM variables --->
<CFSET assignor = "John Q. Assignor"/>
<CFSET actnItemId = 10/>
<CFSET aiTextRev = 2/>
<CFSET actnItemSubj = "The subject line goes here"/>
<CFSET actnReqd = "Perform an analysis of the submitted data item."/>
<CFSET dueDate = "Oct 13, 2005"/>
<!--- Example One: demonstration of the problem --->
<CFMAIL
FROM="sender@myCo.com"
TO="recipient@yourCo.com"
SUBJECT="Example One Test of juxtaposed pound signs">
Assignor: #VARIABLES.assignor#
Action Item: #VARIABLES.actnItemId#
Revision: #VARIABLES.aiTextRev#
Assignment Date: #dateFormat('Oct 09, 2005', "mmm dd, yyyy")#
Subject: #VARIABLES.actnItemSubj#
#VARIABLES.actnReqd#
Resubmit a rewrite of your Response to the above Action Item Assignment by
#VARIABLES.dueDate#. If you have any questions regarding my disposition action, please
contact me at your earliest opportunity.
</CFMAIL>
<!--- Example Two: use of period after subject to 'fool' ColdFusion --->
<CFMAIL
FROM="sender@myCo.com"
TO="recipient@yourCo.com"
SUBJECT="Example One Test of juxtaposed pound signs">
Assignor: #VARIABLES.assignor#
Action Item: #VARIABLES.actnItemId#
Revision: #VARIABLES.aiTextRev#
Assignment Date: #dateFormat('Oct 09, 2005', "mmm dd, yyyy")#
Subject: #VARIABLES.actnItemSubj#.
#VARIABLES.actnReqd#
Resubmit a rewrite of your Response to the above Action Item Assignment by
#VARIABLES.dueDate#. If you have any questions regarding my disposition action, please
contact me at your earliest opportunity.
</CFMAIL>
<!--- Example Three: use of work around variable definition to eliminate the two
ColdFusion variables side by side. This version has no extra, unwanted
characters in the email message --->
<CFSET workAroundVar = VARIABLES.actnItemSubj & CHR(10) & CHR(13) & VARIABLES.actnReqd/>
<CFMAIL
FROM="sender@myCo.com"
TO="recipient@yourCo.com"
SUBJECT="Example Two Test of juxtaposed pound signs">
Assignor: #VARIABLES.assignor#
Action Item: #VARIABLES.actnItemId#
Revision: #VARIABLES.aiTextRev#
Assignment Date: #dateFormat('Oct 09, 2005', "mmm dd, yyyy")#
Subject: #workAroundVar#
Resubmit a rewrite of your Response to the above Action Item Assignment by
#VARIABLES.dueDate#. If you have any questions regarding my disposition action, please
contact me at your earliest opportunity.
</CFMAIL>
</BODY>
</HTML>