What am I doing wrong here?
In my config file I have this line:
payments.mail.partner = [
some_partner: "partner@email.com",
other_partner: "partner2@email.com"
]
In a service I'm trying to access the email address depending on the key. It seems like I should be able to just access it like this, where the partner parameter corresponds to the key in the config array.
def getPartnerEmail(partner) {
String partnerEmailAddress = grailsApplication.config.payments.mail.partner[partner]
}
However this just returns a Groovy object. I tried converting it to a string but no luck. Where am I going wrong?