How to override the From option in Grails email plugin

After installing the grails mail plugin, when I tried to use the ff code:

mailService.sendMail {
  to recipients.toArray()
  from "${userEmail}"
  subject "${url?.article?.title}"
  html g.render(template:"/promote/email_template", model: [newsUrl : newShortUrl, news : url?.article, comment: status, user : user, rootUrl : rootUrl])
}

But the parameter fromreturns NOT userEmail data, but the email address used in the configuration file. Is there a way to override this and use other data (userEmail)?

I suggested that since the From parameter can be used, I can set it with any email address that the current user is using.

+3
source share
1 answer

from, grails.mail.default.from. , , . SMTP- ?

+2

Source: https://habr.com/ru/post/1788419/


All Articles