I am relatively new to Yii and I am sure that I don’t understand all concepts good enough, so I am sorry, if the question is a dumb one.
I was wondering, could I use view to render email message, which to send using the PHP mail function? I want to use the power of Yii in the email body, but I don’t want to store the template in the model/controller. So, how can I do this?
That’s exactly how i do it in my mailer component, so: yes, it’s surely possible. You can use Yii::app()->controller to get the current controller. It provides the two useful methods resolveViewFile() and renderFile() which you can use to render your email templates with a set of parameters.