[RESOLVED] Inserting PHP variables into imported HTML template
Not sure if this is possible but I will give an overview of what I'm trying to achieve.
I am building a notification email - basically it is just going to send a notification email to the administrator indicating whether the process was successful or unsuccessful.
The email is the same every time except I will change the following values:
- Customer Name
- File Name
- File Details
- Time of Day
What I was hoping to do was build the HTML template and simply include it in the PHP class, replacing the place holder with the actual variable information I generate when processing a file.
Is this possible or will it require a custom built script to do a find and replace?
I would just make the template PHP code itself.
Then just call that function in your email script wherever you need that text, supplying the 4 parameters that change for each message.
function getEmailText($custName, $fileName, $fileDetails, $time)
$text = <<<EOD
Blah blah blah $custName.
Yadda yadda $fileName yadda $fileDetails yadda yadda.
Et cetera, et cetera, and so forth at $time.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
How to Ask Questions the Smart Way
(not affiliated with this site, but well worth reading)
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread