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:
well, you can try this code...
mailService.sendMail {
to user.email
from "email@test.com"
subject "MySubject"
body(view:'/emails/mailTemplate', model: [a:A])
}
here mailTemplate.gsp is in view/emails. In body of mail service you can use render syntax.
then add '<%@ page contentType="text/html" %>' in top of mailTemplate.gsp