tag:help.appveyor.com,2012-11-13:/discussions/questions/17212-environments-variablesAppVeyor: Discussion 2018-03-08T18:43:20Ztag:help.appveyor.com,2012-11-13:Comment/446222302018-01-29T21:28:56Z2018-01-29T21:28:56ZEnvironments - Variables<div><p>Environment variables available during the build are not available during Environment deployment. However any data from <a href="https://www.appveyor.com/docs/notifications/#webhook-payload-default">webhook payload</a> is available for notification. You can create custom notification message template as described <a href="https://www.appveyor.com/docs/notifications/#customizing-message-template">here</a>, using data from webhook template. You can use it with any other notification provider, not only webhook notification provider. Please note that for notifications from Environment deployments, you have to prefix variables with <code>build</code>, e.g. <code>build.commitAuthor</code>.</p>
<p>If this does not help, please let us know more details.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/446222302018-01-29T21:40:57Z2018-01-29T21:40:57ZEnvironments - Variables<div><p>Is Environment Name available? I could hard code it but it would be better to get from a variable.</p></div>kneufeldtag:help.appveyor.com,2012-11-13:Comment/446222302018-01-29T21:55:12Z2018-01-29T21:55:12ZEnvironments - Variables<div><p>Do you always deploy from the build or also using Environments UI and API?</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/446222302018-01-29T21:56:47Z2018-01-29T21:56:47ZEnvironments - Variables<div><p>using the Environments for now.</p></div>kneufeldtag:help.appveyor.com,2012-11-13:Comment/446222302018-01-29T22:02:00Z2018-01-29T22:06:32ZEnvironments - Variables<div><p>Then I do not see the way to do this other than hard-coding it in your custom notification template. As long as notification settings are not being shared between environments, I do not think that it is very bad to hard-code it...</p>
<p>Just FYI, if notification is connected to the build, you could use <a href="https://www.appveyor.com/docs/notifications/#adding-custom-value-to-notification">this trick</a> to add custom value.</p>
<p><strong>Update</strong>: You also can use <a href="https://www.appveyor.com/blog/2015/11/04/deployment-projects/">deployment project</a> instead of environments but this is probably too much work if it only solves the problem we are discussing.</p></div>Ilya Finkelshteyn