Use Velocity to generate email

I think I tried that, but it made it a little too easy to call sendMessage
with zero addresses.


On Mon, Jul 14, 2014 at 11:22 AM, Carlos Munoz <notifications@github.com>
wrote:

> In zanata-war/src/main/java/org/zanata/email/EmailBuilder.java:
>
> > +                ClasspathResourceLoader.class.getName());
> > +        // this allows unit tests to detect missing context vars:
> > +        ve.setProperty("runtime.references.strict", true);
> > +        ve.init();
> > +        return ve;
> > +    }
> > +
> > +    /**
> > +     * Build message using 'strategy' and send it via Transport to 'toAddress'.
> > +     * @param strategy
> > +     * @throws javax.mail.MessagingException
> > +     * @throws java.io.UnsupportedEncodingException
> > +     */
> > +    public void sendMessage(EmailBuilderStrategy strategy,
> > +            InternetAddress toAddress, String receivedReason)
> > +            throws MessagingException, UnsupportedEncodingException {
>
> Suggestion: Why not combine the two sendMessage methods into a single one
> with varargs:
>
> public void sendMessage(EmailBuilderStrategy strategy, string receivedReason, InternetAddress ... toAdresses)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/zanata/zanata-server/pull/534/files#r14861698>.
>