cfmail group attribute throws error

后端 未结 2 617
不知归路
不知归路 2021-01-28 03:38

I have a query which returns multiple results with just data in one column as different for a particular report number. I want to group the results for one report number and sen

相关标签:
2条回答
  • 2021-01-28 03:59

    I believe your actual problem is that you're using pound signs in the group attribute.

    group="#investigation_id#" should be group="investigation_id"

    --Edit--

    This below answer is moot as the OP was misleading.

    I think this is because you do not need cfoutput tags inside the cfmail tag. It's odd that it causes a mail error, though.

    anyway...

    I would try using cfsavecontent then output the variable in the cfmail.

    <cfsavecontent variable = "mailBody">
        <cfoutput query="qryCorrectiveDueDate" group="investigation_id">
            <b>#action_who_email#</b><br>
            <cfoutput>
                Report ID: #report_id#</br>
                Report Number:  #report_number#</br>
                investigation id:   #investigation_id#</br>
                Action Who :#action_who#</br>
                Action What: #action_what#</br>
                Action When: #action_when#</br>
                Action type:#action_type#</br>
                Action Complete Date: #action_complete_date#</br></br>
            </cfoutput>
            </br> 
        </cfoutput>
    </cfsavecontent>
    
    <cfmail ...>
        #mailBody#
    </cfmail>
    
    0 讨论(0)
  • 2021-01-28 04:03

    Now that you've removed the hash tags, your issue is likely a missing cfoutput tag in the email. Similar to the group attribute of the cfoutput tag, you need another cfoutput tag to loop through the grouped records.

    Tested on CF8 locally.

    <cfmail query="q" group="field">
        <cfoutput>
            #field# - #field2#
        </cfoutput>
    </cfmail>
    
    0 讨论(0)
提交回复
热议问题