I am using a plugin that provides email functionality as follows:

class SendSesMail {

    //to
    void to(String ... _to) { 
        this.to?.addAll(_to)
        log.debug "Setting 'to' addresses to ${this.to}"
    }

}

The documentation states the class is called as follows:

sesMail {
    from "from@a.com"
    replyTo "reply@a.com"
    to "t@a.com", "t@b.com", "t@c.com"
    subject "Subject"
    html "Body HTML"
}

In the code a List of addresses is built up and I'm trying to figure out how to convert this list to the var args expected by the method.

Converting to a String concatenated with "," doesn't work as this is an invalid email address. I need to be able to separate each List item into a separate parameter to avoid having to iterate over the List and send each email individually.

Edit
Report