I am having trouble reading in a file and using it as a template in PHP. A portion of my code is pasted below. For some reason it never finds $$USER_NAME$$ in the string so it never replaces. I also pasted the beginning part of my template below.
$filename = "email/templates/welcome.txt";
$file = fopen($filename, "r")
$body = fread($file, filesize($filename));
fclose($file);
$body = str_replace("$$USER_NAME$$", "John Doe", $body);
print($body);
Template:
<p>
<img src="emailPic" alt="Logo" />
</p>
<p>Dear $$USER_NAME$$,</p>
<p>Thank you for registering to attend $$EVENT_NAME$$. We look forward to helping you reach your networking goals at $$EVENT_SHORT_NAME$$.
</p>...
Any ideas about why it wouldn't find $$USER_NAME$$ in the template?