Controller Miscellaneous Functions any controller
Sends an email using a template and an optional layout to wrap it in.
Besides the CFWheels-specific arguments documented here, you can also pass in any argument that is accepted by the
cfmail tag as well as your own arguments to be used by the view.
|template||string||No||The path to the email template or two paths if you want to send a multipart email. if the
|from||string||No||Email address to send from.|
|to||string||No||List of email addresses to send the email to.|
|subject||string||No||The subject line of the email.|
|layout||any||No||false||Layout(s) to wrap the email template in. This argument is also aliased as
|file||string||No||A list of the names of the files to attach to the email. This will reference files stored in the
|detectMultipart||boolean||No||true||When set to
|deliver||boolean||No||true||When set to
|writeToFile||string||No||The file to which the email contents will be written|
// Get a member and send a welcome email, passing in a few custom variables to the template newMember = model("member").findByKey(params.member.id); sendEmail( to=newMember.email, template="myemailtemplate", subject="Thank You for Becoming a Member", recipientName=newMember.name, startDate=newMember.startDate );