kefirfromperm / grails-asynchronous-mail

The Grails Asynchronous Mail plugin
http://grails.org/plugin/asynchronous-mail
21 stars 36 forks source link

StringUtils class missing #63

Closed animator013 closed 8 years ago

animator013 commented 8 years ago

Hi there!

I am getting error when sending async email.

Caused by: groovy.lang.MissingPropertyException: No such property: StringUtils for class: grails.plugin.asyncmail.AsynchronousMailMessage
    at grails.plugin.asyncmail.AsynchronousMailMessage$__clinit__closure2$_closure6$_closure9.doCall(AsynchronousMailMessage.groovy:215)
    at grails.plugin.asyncmail.AsynchronousMailMessage$__clinit__closure2$_closure6.doCall(AsynchronousMailMessage.groovy:214)
    at grails.validation.AbstractConstraint.validate(AbstractConstraint.java:107)
    at grails.validation.ConstrainedProperty.validate(ConstrainedProperty.java:979)
    at grails.plugin.asyncmail.AsynchronousMailPersistenceService.save(AsynchronousMailPersistenceService.groovy:12)
    at grails.plugin.asyncmail.AsynchronousMailService.sendAsynchronousMail(AsynchronousMailService.groovy:46)
    at grails.plugin.asyncmail.AsynchronousMailService.sendMail(AsynchronousMailService.groovy:70)
...

When I looked into your code I think that you are missing an import.

headers(nullable: true, validator: { Map<String, String> map ->
            boolean flag = true
            map?.each { String key, String value ->
                if (StringUtils.isBlank(key) || StringUtils.isBlank(value)) {
                    flag = false
                }
            }
            return flag
        })

But that class is not imported anywhere:

package grails.plugin.asyncmail

import grails.plugin.asyncmail.enums.MessageStatus
import groovy.transform.ToString

import static grails.plugin.asyncmail.enums.MessageStatus.*

I switched also to your old branch 1.x and the import seems to be there. Can you fix it ?

kefirfromperm commented 8 years ago

Fixed in 2.0.0.RC4