6 Replies Latest reply on Oct 10, 2006 8:55 AM by Newsgroup_User

    variable in a variable

    Level 7
      I am attempting to create a bulk mailer for my law school. The user can
      create a newsletter and upload a csv for a temporary dataset to populate the
      email addresses on the loop. I would also like it so that they can include
      the name of the person they are mailing by inserting a simple 'word'
      (#name#).

      They first create and save the newsletter. Then they can create a new
      campaign by entering the email subject and choose thier newsletter from a
      populated list. They also browser for the csv for upload and click continue

      The csv is converted to a dataset and weighed against an optout database to
      produce a final list of acceptable email addresses. They click send and away
      they all go.

      I told you all that to ask you all this:

      How can I merge the coldfusion ## to grab the persons name during the
      mailing? Can it be saved in the html text of the email and then, when looped
      and mailed, it can populate that with the name field of the dataset?

      When I tried, I got : Dear #name#

      I have manually text I entered into the email at the bottom (the optout) and
      it merges fine, just not the newsletter itself (#campaign.html#).

      Is there anyway to have coldfusion evaluate the variables inside of another
      variable after that is evaluated?

      <cfloop query="mailist">
      <cfmail from="#campaign.emailfrom#" to="#mailist.email#"
      failto="bounce@avemarialaw.edu" replyto="#campaign.emailreply#"
      server="****" subject="#campaign.subject#">
      <cfoutput>#campaign.html#<br /><br />
      Your name has been provided to Ave Maria School of Law by the Law School
      Admissions Council Candidate Referral Service.<br />If you wish not to
      receive future communications, <a
      href=" http://www.avemarialaw.edu/mailings/optout.cfm?email=#mailist.email#&name=#mailist.name#"> please
      click here.</a></cfoutput>
      </cfmail>
      </cfloop>