Here is a function I wrote to send an email via Elastic Email. It accepts a query and a template. It matches any fields from the query and populates the template. You will need to user all uppercase when placing variables in your template because in ColdFusion query column names are all uppercase, for example {FIRSTNAME} works in your template and {firstname} wouldn't work. You can also over ride the template subject if needed.

    public any function sendElasticEmailFromQuery(myQuery,template,subject="")
        {
            LOCAL.httpService = new http();
            LOCAL.httpService.setMethod("post");
            LOCAL.httpService.setCharset("utf-8");
            LOCAL.httpService.setUrl(THIS.SENDURL);
            LOCAL.httpService.addParam(type="formfield",name="username",value=THIS.FROM);
                LOCAL.httpService.addParam(type="formfield",name="api_key",value=THIS.API_KEY);
            LOCAL.httpService.addParam(type="formfield",name="from",value=THIS.FROM);
            LOCAL.httpService.addParam(type="formfield",name="from_name",value=THIS.FROM_NAME);
            if(arguments.subject neq "")
                LOCAL.httpService.addParam(type="formfield",name="subject",value=ARGUMENTS.subject);
            LOCAL.httpService.addParam(type="formfield",name="to",value=ARGUMENTS.myquery.email);
            LOCAL.httpService.addParam(type="formfield",name="template",value=ARGUMENTS.template);
            LOCAL.httpService.addParam(type="formfield",name="merge_YEAR",value=datepart('YYYY',now()));
            LOCAL.columns=ARGUMENTS.myQuery.GetColumnNames();
            for (local.i=1; LOCAL.i LTE arraylen(LOCAL.columns); LOCAL.i=LOCAL.i+1)
            {
                LOCAL.temp=evaluate("ARGUMENTS.myQuery."& LOCAL.columns[i]);
                LOCAL.httpService.addParam(type="formfield",name="merge_#LOCAL.columns[i]#",value="#LOCAL.temp#");
            }
            LOCAL.result = LOCAL.httpService.send().getPrefix();
        }