ProForm / Email Template / Send Email with PHP / variables

Is it possible to pass any php-variables to the template if I generate emails using PHP?

Is it possible to use those php-variables inside the email template
a) to map php-variables to text-var’s inside an email (email template)
b) to create if/else rules using such php-var’s
Maybe there is a simple workaround? (using e.g. the html block with php inside???)

Important: Those variables needs to be available in the html block too!