I am sending notification emails to members in an organisation using <cfmail> in ColdFusion.
The cfm page is reading member records in the database and sending emails to members using the database field values FirstName, LastName, emailAddress, Age etc.
The email message that members receive should show different fees/prices depending on their age.
So, basically what I need to do is, read member's age from database records, calculate appropriate fees and display on the email message generated by ColdFusion.
I am trying to use <cfif> to determine/set correct fees but I don't know the correct syntax.
<cfquery name="qryMembers" datasource="cfdsnMembers">
SELECT FirstName, LastName, emailAddress, Age FROM MembersTable
<cfmail query = "qryMembers" from="Rainbow Club <email@example.com>" to="#FirstName# #LastName# <#emailAddress#>" Subject="Half yearly membership fee" type="html">
<p>Dear #FirstName# #LastName#,</p>
<p>The amount of your half yearly membership fee is:
<cfif #Age# < 25>$100<cfelse 25 <= #Age# < 55>$120</cfif>
The code shown above causes error.
Please show me the correct way of writing <cfif> conditional codes inside the <cfmail> tag.