Proper syntax for an email notification distro list per environment

blake.duffey's Avatar


07 Feb, 2018 04:19 PM

Assume a dev and test environment. I want to send an email to the developer on each deployment to dev and an email to the developer+the tester to each deployment to test.

I have created a variable NotificationRecipients and scoped it per environment/role (see attached). Apparently this isn't the proper approach?


  1. 1 Posted by blake.duffey on 07 Feb, 2018 04:21 PM

    blake.duffey's Avatar

    i get this error:
    The step failed: Activity Deployment Notification on the Octopus Server failed with error 'The specified string is not in the form required for an e-mail address.'.

  2. Support Staff 2 Posted by Kenneth Bates on 09 Feb, 2018 02:10 AM

    Kenneth Bates's Avatar

    Hi Blake,

    Thanks for getting in touch! Since the email step runs on the Octopus server, it's unable to evaluate role-scoped variables. I've hit the exact same error when using your same set up, but it worked as expected when my NotificationRecipients variables were scoped only to environments. Would that work for your scenario?

    I hope this helps! Don't hesitate to reach out if you have any further questions going forward. :)

    Kind regards,


  3. 3 Posted by blake.duffey on 09 Feb, 2018 12:35 PM

    blake.duffey's Avatar

    Thanks for the reply - for clarity: role-scoping only applies to deployment targets?

  4. 4 Posted by blake.duffey on 09 Feb, 2018 03:29 PM

    blake.duffey's Avatar

    In a related vein - is there a way to use variables in a way to leverage Octopus teams?

    (I see where I can send directly to a Team - but i'd like to have one distro list for each environment). Seems to me the ideal way would be create a variable such as NotificationRecipients, scoped per environment, but each one being an Octopus team.


  5. Support Staff 5 Posted by Kenneth Bates on 13 Feb, 2018 01:18 AM

    Kenneth Bates's Avatar

    Hi Blake,

    Thanks for following up! You're correct - scoping variables to roles means they'll apply to machines that have that specific role assigned to it.

    The team section in email steps is unable to be bound to variables, unfortunately. You could work around it by creating duplicate email steps, where each would be configured to send an email to a single team, and scope each step to the applicable environment.

    You can also take advantage of our subscriptions feature. This allows you to subscribe to events, and when they occur in Octopus, an email or webhook notification will automatically be sent. You can configure subscriptions to send notifications to teams, and scope them to events occurring in specific projects, environments, etc. You can read more about subscriptions in our documentation.

    I hope this helps! Don't hesitate to reach out if you have any further questions going forward. :)

    Kind regards,


Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Already uploaded files

  • Capture.JPG 22.1 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac