-
-
Save uttamhn/8647a7d180084eac9f0e to your computer and use it in GitHub Desktop.
Mail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mail { | |
static transactional = false | |
def grailsApplication | |
def ctx = ApplicationHolder.application.mainContext.servletContext | |
def contextPath = ctx.getRealPath(Constants.PATH) | |
def sendEmail={company,viewName,subjectText,card-> | |
def cardDetails=company.getCreditCard() | |
def ApplicationURL = grailsApplication.config.environment.application.url | |
def currentDate = new Date().format("MMM dd, yyyy") | |
sendMail { | |
multipart true | |
to company.email | |
subject subjectText | |
inline 'springsourceInlineImage', new File(contextPath) | |
body( | |
view:viewName, | |
model:[name:company.title+' '+company.location, | |
email:company.email, | |
displayDate:currentDate, | |
orderValue:"\$"+new DecimalFormat("#.00").format(credit), | |
applicationUrl:ApplicationUrl] | |
) | |
} | |
isMailSent = true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment