title: Environment variables added in pipeline not accessible in email-ext plugin
body: <p>In my pipeline script, I added a few environment variables but wasn't able to access it in the email-ext plugin</p>
  
  <pre><code>env.MYVAR = 'HELLO'
  
  emailext body: '${ENV,var="MYVAR"}', subject: 'subject', to: 'hello@world.com'
  </code></pre>
  
  <p>Since I am reading the email body from a file, I've also tried replacing string but got java.lang.NullPointerException at org.codehaus.groovy.runtime.StringGroovyMethods.replaceAll</p>
  
  <pre><code>def myvariable = 'HELLO WORLD'
  def content = readFile 'template.html'
  content = content.replaceAll('MYVAR',myvariable)
  ...
  </code></pre>
  
  <p>Any idea? Thanks!</p>