如何在邮件正文中包含href标签?

时间:2018-08-03 06:23:27

标签: grails

我正在使用grails邮件插件发送电子邮件,如下所示。我如何在身体中包括链接?

mailService.sendMail{
                    delegate.to em
                    delegate.subject params['subject']
                    delegate.body "${params['body']} \n\nPlease click <a href='${l}'> Unsubscribe </a> to unsubscribe from the list."
                }

在收到的电子邮件中,收件人为

Please click <a href='https://ne-palmr.com/road/subscriptionCancellation/cancelSubscription?email=test%40gmail.com&from=979&t=d4007eb1ec361d8c3ec82f9525af2d08'> Unsubscribe </a> to unsubscribe from the list.

预期结果是

Please click Unsubscribe to unsubscribe from the list.

1 个答案:

答案 0 :(得分:0)

此处将重复Slack答案:您需要将body更改为html。 另外,您无需在方法前使用delegate