Email notifications "Send an email" step

Hi, I am using Octopus step “Send an email” to send out notifications. It works fine but the issue I am struggling with is…

I am sending an email
To: #{Octopus.Deployment.CreatedBy.EmailAddress} - (This will always have a value)
CC: #{EmailNotifyList} - (Reading from Variables; scoped to an Environment; This may or may not have a value for each environment)

For the environments which doesnt have a variable #{EmailNotifyList} set, I just wanted to ignore it and send it only to “#{Octopus.Deployment.CreatedBy.EmailAddress}” which seems to be failing because of CC doesnt have the correct value.

This seems to be a bug in the step itself. Can you please let me know if there is a workaround?

Hi,

Thanks for getting in touch! I’m sorry you’re hitting this issue. If there’s no variable scoped to the environment you’re deploying to, it will cause the step to fail. I was able to get it working as expected by creating a dummy variable in the project, with an empty value and scoped to the other environments. Would this workaround work for you? :slight_smile:

Let me know how you go and if you have any further questions!

Kind regards,

Kenny

Hi Kenny,

Thanks for your response.

I just created a variable with no value and no env. scope and it seems to working fine for my case.

Thanks again.

Hi,

You’re very welcome! It’s great to hear that solution is working for you. Thanks for taking the time to let me know. Don’t hesitate to reach out if you have any further questions going forward. :slight_smile:

Kind regards,

Kenny