I’m trying to send an email at the end of the Octopus Deploy process to indicate the success or failure of the deployment.
The subject consists of:
#{Octopus.Project.Name} Deploy to #{Octopus.Environment.Name} of release #{Octopus.Release.Number} - #{unless Octopus.Deployment.Error}Successful#{/unless}#{if Octopus.Deployment.Error}Failure#{/if}
and is working correctly. However, the Body of the email begins with the same line, but Octopus sends the email out with the string still containing the variable names “#{Octopus.Project.Name} Deploy to #{Octopus.Environment.Name}”…
I’ve read about limitations with regards to variables one can access from the email process, but I’d assumed that if I can use a variable in the Subject, I could also use it in the email Body.
Thanks for getting in touch. This is an interesting one. The variables should definitely be replaced in the email Body. I’ve setup a test and cannot reproduce this problem, so we’ll need some more information to help track down what’s happening.
Could you please send through the specific version of Octopus you’re running (depending on the version, this will either be in the footer or in the top-right help menu).
Can you also please provide screenshots showing your Email step, clearly showing the Subject and Body fields.
Regarding error logs, it gets tricky because some customers have non-Octopus configurations that use their own variable substitution, so we have to tread carefully when reporting that variable syntax may be broken vs ignored in user-generated scripts. In this case, our decision to leave the variables as un-replaced is how we show it as an error.