com.sebtools Build 2 Documentation: Notices

Notices

Mailer.cfc also has the concept of notices which allow you to send personalized information where the contents of the email are dynamic. For example, you could have a user create a message and then send the message to multiple recipients, replacing markers in the email 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:

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.