Mailer.cfc Notices

I have blogged about Mailer.cfc before, but it can do more than send a static email. You can also tell it about a notice that you want to send and later send that notice with personalized information.

To add a notice, use the addNotice() method. You must give the notice a unique name by which Mailer.cfc will reference the notice. The other arguments are the same as the arguments for the send() method. You can also include markers for data by wrapping a word in brackets. For example, you can have "Dear [FirstName]," in the contents and have "[FirstName]" replaced with a first name when you send the notice.

The addNotice() method also has an optional datakeys argument as a list of required variables for which markers are in the notice. 

To send a notice, use the sendNotice() method. This method has just two arguments:

  • name: the name of the notice you want to send
  • data: a structure of data to replace the markers used in addNotice()

So, the data structure could have a "FirstName" key to replace the "[FirstName]" marker. The keys in the structure can also replace any of the arguments of the send() method. For example, it could have a "To" key to replace the "To" argument of the send() method.

That's it!

Mailer.cfc is free and open-source. Version 1.5 is currently in beta. 

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.