On 4/21/07, Marc <[EMAIL PROTECTED]> wrote:
The example shows just variables.notificationService.send(.), but I'm having trouble figuring out how the exact call and the actual implementation would look. What goes inside send()? If the message content itself goes in there, doesn't that get messy? Should all the attributes of a CFMAIL tag be accounted for, and if so, how?
There is of course no "one true answer" here but there are lots of reasonable degrees... A simple send() method might take from=, to=, subject=, body= and, yes, pass in a string containing the message both. I'm using this approach right now for a site I'm working on. Yes, constructing the body in the calling code and passing it in is a little messy. See below. It might take an optional arg containing a struct with any additional <cfmail> arguments you might want to pass in. The next step might be a simple templating engine where you pass in from=, to=, template= and a struct containing values to be substituted into the template. The service loads the template, substitutes all the values (they might be identified by something like $${varname} in the text of the template) and then sends it. This is how adobe.com's mail engine works (both for the main site and for the Hosted Services stuff I worked on, albeit different codebases with slightly different approaches). Again, maybe you might pass additional <cfmail> arguments in via a struct. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm CFCDev is supported by: Katapult Media, Inc. We are cool code geeks looking for fun projects to rock! www.katapultmedia.com An archive of the CFCDev list is available at www.mail-archive.com/cfcdev@cfczone.org