Showing posts with label Kyle Macey. Show all posts
Showing posts with label Kyle Macey. Show all posts

Friday 27 September 2013

CFML: Mostly pointless custom tag exercise

G'day:
Yesterday I wittered on about IRC, and how I landed there as part of an exercise to help Kyle with a code challenge he was having. Kyle wanted to know if it was possible to write a custom tag which emulated <cfmail> (easy), except including the fact one doesn't need to specify <cfoutput> tags in the body of a mail message with <cfmail>. That got me thinking.

First up, here's a <cfmail> example of what I'm talking about:

<cfset msg = "G'day world">
<cfmail to="dac.cfml@example.com" from="dac.cfml@example.com" subject="#msg#">
#msg#
</cfmail>

And this yields:

type:  text/plain; charset=UTF-8
server:  127.0.0.1:25
from:  dac.cfml@example.com
to:  dac.cfml@example.com
subject:  G'day world
X-Mailer:  ColdFusion 10 Application Server
body:   G'day world 

Note how #msg# was resolved in the body of the <cfmail> tag without there being any <cfoutput> tags around it.

If I was to knock out a quick mail.cfm custom tag and try that:

Thursday 26 September 2013

I... aaaah... see

G'day:
That heading works better if one is aware of how non-rhotic the Kiwi accent is.

Anyway, I was wittering away "helping" someone (Kyle Macey) with a CFML problem last night, when someone suugested taking the conversation to a different venue as the list of people being referenced in the conversation was taking up most of the Twitter message space.

And someone suggested using IRC.

Knock me over with a feather... people still use IRC?