3
在您需要的grails郵件插件中,假設您使用服務中的grails郵件,請在服務中定義您的內聯圖像數據。grails郵件:從電子郵件中的數據庫渲染個人資料圖片
你做到這一點,像這樣在你的service.groovy
inline 'header', 'image/jpg', new File('./web-app/images/mailAssets/alert_header_pre.png')
服務定義中,可以說:
def mailService
def contactUser(userName, email) {
mailService.sendMail {
multipart true
to email
from "[email protected]"
subject "Hello from grails-mail"
text "Hallo from grails-mail multipart text modus"
html view:"/alert/test", model:[name:userName]
inline 'header', 'image/jpg', new File('./web-app/images/mailAssets/alert_header_pre.png')
inline 'footer', 'image/jpg', new File('./web-app/images/mailAssets/suchebottomre.gif')
}
}
現在,應用程序被渲染頁腳和標題圖片,好。
好了,現在這個項目的規劃者的計劃是在他們的電子郵件來呈現來自數據庫的個人資料照片(約15.000用戶) - 可以,如果再怎麼能這樣沒有每個用戶的個人資料圖片聲明裏面的服務來實現。常規?此外,這些圖片存儲在我的應用程序以外的亞馬遜S3。這可能是郵件插件的邊界,還是有可能得到這個工作?如果不可能做到這一點,你會爲那些計劃和創意人員提供什麼樣的選擇?任何意見都歡迎。
感謝您對您所提供的信息資料 – thegrunt