Email templating views not showing up correctly

I was trying to do something in this wiki page: http://docs.octopusdeploy.com/display/OD/Email+notifications

It looks like this does not work in OD 2.4.7.85. I have the following code

#{if Octopus.Deployment.CreatedBy.DisplayName}#{Octopus.Deployment.CreatedBy.DisplayName}#{/if}

Which translates too the following in the email:

#{if Octopus.Deployment.CreatedBy.DisplayName}bmontague#{/if}

Is this the correct behavior or is this suppose too only display if the variable exists?

Hi Brent,

Thanks for reporting this!

It looks like you are doing everything correctly in the examples you gave below.
So to help us track down if this is a bug could you please include your full email template as a text file.

We will hopefully then be able to track down where or why the failure is happening and submit a bug fix at that point.

Thanks!

Vanessa

This was the exact line we were using. We just found out about the templates so we have not been using them heavily. I also tried this with both text and html emails and neither seemed to work.

Hi Brent,

Thanks for getting back to me!

After doing some testing, I am seeing that issue if the code is placed in the subject of the email, is that where you are placing the code?
Unfortunately the email subject is not parsed in the same way as the email body, you will find if you put the same code in the body it will work as intended.

I hope this helps!

Vanessa