__OctopusEmailBody contains a reference to another variable named 'Octopus.Step.Package.NuGetPackageId', which is not defined

Ran into this trying to use the mentioned variable in an email body. Am I using this variable incorrectly? I would like the email to contain the packagename and version that was deployed.

Thanks.

@@@
Error

The variable ‘__OctopusEmailBody’ contains a reference to another variable named ‘Octopus.Step.Package.NuGetPackageId’, which is not defined. Set the special variable OctopusPrintVariables to have Tentacle print the value of all variables to help diagnose this problem.
@@@

Deployment log showing variable set.

@@@
2013-04-09 00:29:05 DEBUG - [Octopus.Step.Package.NuGetPackageId] = 'MyService.Id’
2013-04-09 00:29:05 DEBUG - [Octopus.Step.Package.NuGetPackageVersion] = ‘1.0.19’
@@@

My play email template

@@@

Deployment Details:
#{OctopusReleaseWebLink}

Environment: #{Octopus.Environment.Name} Project: #{Octopus.Project.Name} Release: #{Octopus.Release.Number} Id: #{Octopus.Step.Package.NuGetPackageId} Version: #{Octopus.Step.Package.NuGetPackageVersion}

#{OctopusPrintEvaluatedVariables}

@@@

Hi Jesse,

You can’t use those variables from within an email step because they aren’t defined for that step. Imagine you had a deployment with three steps:

  1. Deploy package A
  2. Deploy package B
  3. Send an email

There’s no clear way to know which package ID/version should be shown in the email step, so for now we don’t make them available. In the next release we’ll make it possible however to reference them by index - e.g.,:

Octopus.Step[0].Package.NuGetPackageId

Paul

what version of octopus is this available in … the Step index?

Hi Thom, it was added in the 1.6 releases.

Paul