title: send an email using a template - grails
body: <p>I want to send an email using a template. I want to have a GSP file where i could style it, and send the email. Currently the send mail function is as follows:</p>
  
  <pre><code>def sendEmail(){
  
      mailService.sendMail {
          to "email","**email**"
          from "email"
          subject "Hi"
          body 'Hi'
      }
  }
  </code></pre>
  
  <p>in my <code>config.groovy</code> file</p>
  
  <pre><code>grails {
      mail {
        host = "smtp.gmail.com"
        port = 465
        username = "email"
        password = "pwd"
        props = ["mail.smtp.auth":"true",
                 "mail.smtp.socketFactory.port":"465",
                 "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
                 "mail.smtp.socketFactory.fallback":"false"]
      }
   }
  </code></pre>
  
  <p>I went through another <a href="https://stackoverflow.com/questions/10445785/send-an-image-in-an-email-with-grails">Stack Overflow post</a> on this: Where should i add the mail templates ? is it in the views folder ? </p>
  
  <pre><code>sendMail{
      multipart true
      to "[hidden email]"
      subject "Subject goes here"
      html  g.render( template: '/emails/mailTemplate')
      inline 'springsourceInlineImage', 'image/jpg', new File('./web-app/images/springsource.png')
  }
  </code></pre>
  
  <p>UPDATE</p>
  
  <p>I TREID ADDING A mailTemplate.gsp UNDER <em>EMAILS/</em> BUT IT DIDNT WORK.</p>
  
  <p>ERROR I GOT Template not found for name [/emails/mailTemplate] and path [/emails/_mailTemplate.gsp]</p>