title: How do I force evaluation of a cfif stored in a string?
body: <p>I am trying to store coldfusion code in a database to be used for the subject of a cfmail. The code stored is as follows:</p>
  
  <pre><code>"RE: &lt;cfif myData.general.legalName NEQ """"&gt;  {{dotlegalname}}&lt;cfelse&gt;{{docketLegalName}}&lt;/cfif&gt;,    
  DOT## {{dot}}, Docket ##(s)   {{docketString}}" 
  </code></pre>
  
  <p>When I retrieve string from the database, I use cfsavecontent to attempt to evaluate it.</p>
  
  <pre><code>&lt;cfsavecontent variable="subject"&gt;
   &lt;cfoutput&gt;#myData.email.subject#&lt;/cfoutput&gt;
  &lt;/cfsavecontent&gt;
  </code></pre>
  
  <p>I also tried</p>
  
  <pre><code>&lt;cfsavecontent variable="subject"&gt;
       &lt;cfoutput&gt;#evaluate(myData.email.subject)#&lt;/cfoutput&gt;
  &lt;/cfsavecontent&gt;
  </code></pre>
  
  <p>And then I replace all the {{ }} with the appropriate values.</p>
  
  <p>However, the subject of the email is stubbornly refusing to contain an evaluated cfif, and is instead showing the cfif as if it were a string.</p>
  
  <p>Any ideas?</p>