Email Template missing values

I have an email template I’m using and there are values missing.

Below is the email that is sent. The links throw a 503 service is unavailable and there are some variables with no value.

Email Body values
ERP Deployment Notification: - #{Octopus.Project.Name} - to the #{Octopus.Environment.Name} - Environment

Deployment of #{Octopus.Project.Name} #{Octopus.Release.Number} to #{Octopus.Environment.Name}

Initiated by #{unless Octopus.Deployment.CreatedBy.DisplayName}#{Octopus.Deployment.CreatedBy.Username}#{/unless} #{if Octopus.Deployment.CreatedBy.DisplayName}#{Octopus.Deployment.CreatedBy.DisplayName}#{/if} #{if Octopus.Deployment.CreatedBy.EmailAddress} (#{Octopus.Deployment.CreatedBy.EmailAddress})#{/if} at #{Octopus.Deployment.Created}

#{if Octopus.Release.Notes}

Release notes

#{Octopus.Release.Notes}

#{/if}

Deployment process

The deployment included the following actions:

    #{each action in Octopus.Action}
  • #{action.Name} #{if action.Package.NuGetPackageId}— #{action.Package.NuGetPackageId} version #{action.Package.NuGetPackageVersion}#{/if}
  • #{/each}

View the detailed deployment log.

Task summary

    #{each step in Octopus.Step} #{if step.Status.Code}
  1. #{step | HtmlEscape} — #{step.Status.Code} #{if step.Status.Error}
    #{step.Status.Error | HtmlEscape}
    #{step.Status.ErrorDetail | HtmlEscape}
    #{/if}
  2. #{/if}#{/each}
#{Octopus.Step.Name} - #{Octopus.Step.Status.Code}

Deployment of Package 1.0.0.24911 to Quality Assurance (QA)
Initiated by Mc Raby (mc.raby@hautelook.com) at Tuesday, July 07, 2015 3:06:52 PM
Release notes
Changeset 15175, Checked in by Viet Hoang GetAvailable was returning null quantity and the code didn’t like it. changed it so it can accept null quantities
Deployment process
The deployment included the following actions:
• Windows Service - Stop
• Backup
• Deploy Package — Package version 1.0.0.24911
• Update Configuration File
• Windows Service - Start
• New Relic - Staging Deployment
• Deployment_Notification
View the detailed deployment log.
Task summary

  1. Windows Service - Stop — Succeeded
  2. Backup — Succeeded
  3. Deploy Package — Succeeded
  4. Update Configuration File — Succeeded
  5. Windows Service - Start — Succeeded
  6. New Relic - Staging Deployment — Succeeded
  7. Deployment_Notification — Running
  8. Acquire Packages — Running
    Deployment_Notification - #{Octopus.Step.Status.Code}

Hi MC,

Thanks for getting in touch! Sorry for the delay in getting back to you. The variable that isn’t working for you at the bottom is due to the step hasn’t completed, so it has yet to fail or succeed for ‘Deployment_Notification’ and thus doesn’t have a value to resolve.
As for the links, it is providing the correct location for them all. Are you able to access http://stg-fcsvcs2/ from where the email is being read and the link being clicked?

Vanessa

Hi Vanessa,

I was able to fix the deployment log link however I’m still not able to get the package link to work. Do you provide any UI for downloading the package or is just a save/file link from IIS?

MC Raby

Vanessa,

I have checked and the variable should have a value. The very last step in the deployment is the notification so all step variable should have values before the Notification step. Also I’m having an issue sending to multiple email address.

I get the below error or when trying to send to individuals Octopus email error An invalid character was found in the mail header: ‘,’. Comma is to separate email address right?

Mailbox unavailable. The server response was: 5.1.1 User unknown System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.1.1 User unknown at System.Net.Mail.SmtpClient.Send(MailMessage message) at Octopus.Server.Orchestration.Deploy.Email.EmailActionOrchestrator.d__0.MoveNext() in y:\work\refs\heads\master\source\Octopus.Server\Orchestration\Deploy\Email\EmailActionOrchestrator.cs:line 53 Octopus.Server version 2.6.4.951

MC Raby

Hi Vanessa,

I’m hoping you can help with an issue I have with TFS and Octopus Deploy. I only have a couple of weeks before my demo and I have one major hurdle. I need to pass the changeset information from TFS to Octopus to be include in the release notes for the continuous integration release.

I have searched and I can’t find anything that doesn’t require modifying the build template file. Do you know of a way to do this and if so will you please provide the details.

Thank you!

MC Raby
Senior Release Engineer
Nordstromrack.com | HauteLook
1212 S. Flower St, Suite 300 Los Angeles, CA 90015
(T) 213-741-1890 ext. 131
© 818-281-0048
www.nordstromrack.comhttp://www.nordstromrack.com/
www.hautelook.comhttp://www.hautelook.com/

Hi MC,

Yes sorry you will not be able to get the package links in the manner you are trying. Do you use the internal repository or an external feed?
If you are using the internal feed it will be available as (if your package was DeploymentPackage1.0.0.24911) /api/packages/packages-DeploymentPackage1.0.0.24911/raw

Can you show me what your setting looks like with multiple addresses, something sounds a bit wrong there.

As for your TFS question. It’s really very hard to make it work with the current versions of TFS. Lots of customised PowerShell scripts.
However for vNext this will be the solution: http://octopusdeploy.com/blog/octopus-integration-with-tfs-build-vnext

Vanessa

Hi Vanessa,

I think my Octopus license expires today. I didn’t get a chance to present the POC to management yet but I did implement Octopus across our production and non-production environments and release a three month project using the tool. Management is aware of the time saved using Octopus and has approved the purchase. I need you to extend my license and also send me an invoice to purchase an unlimited licensed for our environment.

Please let me know when this can be done and what are the next steps in the purchase process.

Thank you!

MC Raby

Hi Vanessa,

I’m having an issue resolving this Octopus variable #{Octopus.Machine.Name} in an email notification step template. I’m sure it’s something simple and thought you could help.
It’s looks this way in the notification. ERP Deployment Notification: - Project - to the Development (DEV) Environment - Server #{Octopus.Machine.Name}

Thanks

MC Raby

Hi MC,

It’s nice to hear from you, I hope Octopus is working out well for you.
In this case, your variable is not working because it doesn’t have context. The email step runs on the Octopus Server itself and not from the machine that the other steps will be running from. So that variable will not resolve for that step.

If you need to find the machine name that was run on a specific step you will need to set the variable in the step you require to know the machine of by making use of deploy.ps1 to:
Set-OctopusVariable -name "MachineName" -value $OctopusParameters["Octopus.Machine.Name"]
Then in the email step you would reference: $OctopusParameters["Octopus.Action[Your Step Name].Output.MachineName"]

Note that if you are deploying to more than one machine this will mostly likely come out as the final machine as it will keep getting reset.

Hope that helps!
Vanessa