Send emails from a template with PHP
When you're designing your web application, you'll find that various actions require that an email be sent off. It's easy to hard-code the email into the script. For example, in a tech support web application, you may want to send an email when a user submits a ticket, and another email alerting them of any replies.
But what happens when you have many different emails to send, and they deliver a lot of different, complex information. Then it gets too difficult to maintain many different lines of code for different emails. It's easier to create a generic email template class, and then as many templates as you want. Here's how! (more…)
