Closed shresthaankit7 closed 2 years ago
after long hours on this bug, i finally found a solution : String contentHTML = g.render(template:"registrationHTML", model:[user: user]) String contentTXT = g.render(template:"registrationTXT", model:[user: user]) sendMail { multipart true subject("SUBJECT") from "FROM" to "TO" html contentHTML text contentTXT }
I had this problem and solved it by adding configuration for the grails GSP plugin. see this question and answer
Hello, I've used "org.grails.plugins:mail:2.0.0.RC6" and "org.grails:grails-plugin-gsp" for send emails using grails3. I've called my mail sending service from another controller with the required params and I've kept the required gsp under the grails-app/views/ folder.
The mail sending service is:
The gsp page when my params are mapped is under grails-app/view/email/JobFail.gsp.
Everything in the development environment(using IntelliJ) is working fine but in the production environment, I'm getting a weird issue like: Could not locate mail body /email/JobFail. Is it in a plugin? If so you must pass the plugin name in the [plugin] variable