EmailModel - Unexpected character "$"?
You can't use PHP in a Twig template.

A plugin Craft plugin would be the easiest way to pull off what you're looking for.  I've added an answer to your other related question.