One of my clients has a feature called Email a Patient where website visitors are allowed to send a virtual greeting card to patients in the hospital.
After the user has filled out their card they can preview it and send it along. At that point I just plug the XHTML straight into <cfmail> tags and sent it along to the volunteer department who then print and hand-deliver it to the patient.
There were two problems though:
- The email recipient had to use Outlook to view the email (requirement, not my choice)
- Outlook places a header on the top (Email info: to, from, subject, etc).
I spent a couple hours trying to figure out how to remove the header information. Then it came to me; Why not try the new <cfdocument> tag with CF7 and save it as a PDF? In minutes I was able to solve the problem and possible future problems (like, what if they change email client in the future).
Now I'm sending the PDF as an attachment and using 128-bit encryption on the file as well (That should help calm the HIPAA people. You know who you are! :).
This also convinced the client to upgrade to CF7 (should be devlivered in a few days). Since I've been developing in CF7 anyway I already know the website will function once they upgrade.