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.
source
share