On Jan 7, 2004, at 7:57 PM, Andrew Scott wrote:
In regards to components and functions etc., I am looking at creating a
function to be generic to emails. Now should I create code in the cfc to
format the email or do an include for this.

Consider something like this (untested idea):


        <cffunction name="sendEmail" ..>
                <cfargument name="template" type="string" ..>
                ...
                <!--- put data in request.someStruct --->
                <cfsavecontent variable="body">
                <cfinclude template="/emails/#arguments.template#.cfm">
                </cfsavecontent>
                <!--- send email with #body# --->
        </cffunction>

Now the email formatting is all in a separate set of files and the CFC is "clean". You'd need something more complex for both HTML and plain text email, but the same principle applies.

Hope that helps?

Sean A Corfield -- http://www.corfield.org/blog/

"SOAP is not so much a means of transmitting data but a mechanism for calling COM objects over the Web."
-- not Microsoft (surprisingly!)


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.


CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to