Fetching some value from message.properties in Grails
问题 Want to fetch a value from message.properties file in grails in a job , how can I do that ?? My Job: def execute() { // execute task List<String> emails = NayaxUser.findAllByEmailSent(false)*.username emails.each {emailAddress-> mailService.sendMail { //todo: FETCH FROM MESSAGE.PROPERTIES to emailAddress from FETCH FROM MESSAGE.PROPERTIES subject FETCH FROM MESSAGE.PROPERTIES html body.toString() } } } 回答1: You can use: g.message(code: 'my.message.code') //or g.message(code: 'my.message.code'