Re: [railo] cfmail subject dynamic value issue

85 views
Skip to first unread message

Jean Moniatte

unread,
May 24, 2013, 1:49:00 PM5/24/13
to Railo Google Group
If it is in a query loop, make sure to scope the variable name with the name of the query: #variables.queryName.company#

Thanks,
Jean
--
Jean Moniatte
UGAL



On Fri, May 24, 2013 at 7:23 PM, <mhpr...@gmail.com> wrote:
<cfmail to="ad...@amstech.com"   bcc="ha...@amstech.com"
   from="ama...@amstech.com" subject="#company# - Dues Invoice" type="html">

Here company is dynamic value from query output:
So email subject should like this:  Infineon - Finn Felsberg c/o LSL GmbH - Dues Invoice  but email subject displaying as: Infineon - Finn Felsberg


I try ed below way:
<cfset sub1 = "#COMPANY#">
<cfset  sub2 = "- Dues Invoice">
<cfset sub = sub1 & sub2>

<cfmail to="ad...@amstech.com"   bcc="ha...@amstech.com"
   from="ama...@amstech.com" subject="#company# - Dues Invoice" type="html">

Still subject displaying as: Infineon - Finn Felsberg


How we can fix the issue??

Regards,
Hari.

--
Did you find this reply useful?  Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki


If you don't have time, add a request to the Railo Server wiki to-do page at https://github.com/getrailo/railo/wiki/Todo
---
You received this message because you are subscribed to the Google Groups "Railo" group.
For more options, visit https://groups.google.com/groups/opt_out.



James Kilford

unread,
May 24, 2013, 4:16:07 PM5/24/13
to ra...@googlegroups.com
It's a weird place to get cut off... Are there any special characters involved?  Can you output the company in the body of the email temporarily, just to make sure it's a problem with the subject?  Do other companies work okay? 

James

James Kilford

unread,
May 24, 2013, 4:17:51 PM5/24/13
to ra...@googlegroups.com
BTW, in your second way, you still use "#company# - Dues invoice" as the subject. Should it be subject="#sub#" ?

James

James Kilford

unread,
May 24, 2013, 4:21:10 PM5/24/13
to ra...@googlegroups.com
I just tried it in CFMAIL (sorry, I may have some of you because I copied your code!) and I got a bounce.  In the bounce the subject came back correctly: 

To: ad...@amstech.com
Subject: Infineon - Finn Felsberg c/o LSL GmbH - Dues Invoice
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8

from this code: 

<cfset company = "Infineon - Finn Felsberg c/o LSL GmbH">
<cfmail to="ad...@amstech.com"   bcc="ha...@amstech.com"
   from="ama...@amstech.com" subject="#company# - Dues Invoice" type="html">
</cfmail>



andreas

unread,
May 24, 2013, 5:15:53 PM5/24/13
to ra...@googlegroups.com

Hi Hari,

just guessing, and please ignore if you've already done that: But if you already did what jean said and still are having the same issue: did you already check the query-output through a raw sql-client? because it might also be a sql-statement returning wrong records.

best wishes

mhpr...@gmail.com

unread,
May 25, 2013, 9:38:01 AM5/25/13
to ra...@googlegroups.com
Dear ALL,

Thanks for your response.
I try ed Jean suggestions. But still same issue.
with in cfmail company name displaying good.
<cfmail subject="#variables.getData.company#"> #variables.getData.company#</cfmail>
subject displaying as: Infineon - Finn Felsberg
mail content displaying as: Infineon - Finn Felsberg c/o LSL GmbH

Here is complete code:


<cfoutput>
<cfset  current_date = "#DateFormat("# Now()#", "mm/dd/yyyy")#">

<cfstoredproc datasource="gsa_prod"  procedure="Client_INVOICE_60_DAYS_SP">
  <cfprocparam type = "IN"       CFSQLType ="CF_SQL_INTEGER"  value = "1">
  <cfprocparam type = "IN"       CFSQLType ="CF_SQL_VARCHAR"  value = "#current_date#">
  <cfprocresult name = "getData">
</cfstoredproc>
</cfoutput>

<cfif isdefined("getData")>
  <cfif #getData.recordcount# gt 0>
    
 <cfoutput query="getData">

 <cfmail to="ha...@dis.com"  from="ad...@client.org" type="html" 
 subject="#variables.getData.company# - Dues Invoice test">


          #variables.getData.company#

        </cfmail>

</cfoutput>
</cfif>
</cfif>


Regards,
Hari

Matt Quackenbush

unread,
May 25, 2013, 9:42:13 AM5/25/13
to ra...@googlegroups.com

You should be using the query attribute of cfmail and NOT nesting the query inside of a cfoutput. With the code written the way you have it, you are getting exactly the behavior I would expect to see.

Sent from my Samsung Galaxy SII

--

mhpr...@gmail.com

unread,
May 25, 2013, 10:30:28 AM5/25/13
to ra...@googlegroups.com
Dear QuackFuzed,

I am looping query output. Since from query output creating Dynamic Invoice PDF, and attaching to email.
Except subject remaining places company name displaying good (Infineon - Finn Felsberg c/o LSL GmbH)
I am wondering if we use static text in the subject i.e. subject="Infineon - Finn Felsberg c/o LSL GmbH"
working fine. But query output trim the subject. 

Can you please try you end, get subject from query output then send eamil, make sure company name in the DB is "Infineon - Finn Felsberg c/o LSL GmbH"

I think this issue only for this company, remaining company names displaying good. 

Regards,
Hari.


mhpr...@gmail.com

unread,
May 26, 2013, 8:25:13 AM5/26/13
to ra...@googlegroups.com
Dear ALL,
Issue fixed by adding replace character.
My friend given below solution.

<cfset newcompany = #replace(company,"/", chr(8260))#>

<cfset newsubject = "#newcompany# - Dues Invoice">


Regards,

Hari.

Peter Boughton

unread,
May 27, 2013, 7:45:36 AM5/27/13
to ra...@googlegroups.com
Hari wrote:
> Issue fixed by adding replace character.
> My friend given below solution.
>
> <cfset newcompany = #replace(company,"/", chr(8260))#>
> <cfset newsubject = "#newcompany# - Dues Invoice">


I haven't followed this whole issue, but are you saying that the presence of a forward slash (/) in the mail subject causes it to be truncated?

If so, have you confirmed this is occurring at the Railo level, not the mail server or mail client level?

mhpr...@gmail.com

unread,
May 29, 2013, 1:14:57 PM5/29/13
to ra...@googlegroups.com
Hi Peter,

I am not sure whether issue in Railo or Email client level etc..


--Hari
Reply all
Reply to author
Forward
0 new messages