Generic mail templates

With the new version 1.3, a send email step is introduced. I have used it for 1 project now with the following html template:

Deployment status

Project: #{OctopusProjectName}
Version number: #{OctopusReleaseNumber}
Environment: #{OctopusEnvironmentName}

As you can see, this email is very generic and sending the email after a deployment works like a charm. But I want to define this email on a higher level so every project can make use of this email template.

Is there a way to do this?

Hi Pascal,

Currently there is no way to reuse the template. This is a feature we’ll try to add in a future release.

Paul

I was creating an email template as a variable set - so that thet body of the email could be generic across the board - looks like this doent work as expected, would be nice to be able to share an email template across all projects

Thanks
Gregor

Can an email template really only be used within a step - was hoping to reuse a variable but it doesn’t seem to work - even though im selecting it as HTML - it doesn’t parse correctly.

Are you still using version 1.3? In version 2.4 you can use the Step Templates feature to handle this. We’ve been doing it for a while now works great and would do what you are wanting.

If you are in 2.0+ (with Step Templates) here’s what we use as an example:

Subject: #{Octopus.Project.Name} has been deployed to #{Octopus.Environment.Name}
Body: Deployed #{Octopus.Project.Name} to #{Octopus.Environment.Name}.

That’s just a simple example and works for us. But you should be able to do the html style you are wanting.

Hi Gregor,

As David has suggested using a Step Template would be a better idea than using a variable. Currently email steps cannot use bound variables (variables that expand others).
Step templates are reusable.

Vanessa

Hi Folks

I will use a stem template, is it possible to see the step template for Send Email which is built in?

Thanks
Gregor

Hi Gregor,

Sorry I don’t know if I understand the question? Could you explain this with a little more detail please.

Vanessa

Hi Vanessa

Yes sorry - when I am creating my process, I can add a new step, one of the available ones is called Send Email, is it possible to see the PowerShell behind this step.

Hi Gregor,

Unfortunately not - this isn’t a step template or PowerShell, there’s actually C# code in Octopus that sends the email.

Hope this helps,

Paul