[seam-dev] Seam 3 Mail Feedback Follow-up

Cody Lerum cody.lerum at gmail.com
Sun Feb 27 18:22:58 EST 2011


1. From Lincoln

Utilizing an Interface for handling the different ways one could
create an email template. -
https://issues.jboss.org/browse/SEAMMAIL-19

    This is Done.

VelocityMailMessage vmm = velocityMailMessage.get();

      vmm.from("seam at test.test", "Seam Framework")
            .to(person)
            .subject("HTML Message from Seam Mail - " +
java.util.UUID.randomUUID().toString())
            .bodyHtml(new VelocityClassPathTemplate("template.html.vm"))
            .put("version", "Seam 3")
            .importance(MessagePriority.HIGH)
            vmm.send(session.get());

   the contact fields also support a interface as well so one only
need implement a getName and getAddress method on their User entity
(for example) in order to pass it directly into an email -
https://github.com/seam/mail/blob/6f70057cca7da712576c21f44bda80082ae1f0a1/examples/sendmail/src/main/java/org/jboss/seam/mail/example/Person.java

2. From Emmanuel

  a. the from and all contact fields already support a single argument
being the address
  b. the ability to have a var args  to("emmanuel at nothingtosee.org",
"dan at test.com") is something we could do, but we would have to ditch
the to("Dan", "dan at test.com"). People would have to create personal +
address recipients via something like to(new BaseEmailContact("Dan".
"dan at test.com")...more on that further down
  c. all the contact methods (from/to/cc/bcc/replyto) all support
collections being passed into them.
  d. I've added an a no arg send() method
  e. Typesafe templating is going to have to come later and I'm going
to need to lean on someone for inspiration.

3. From Lincoln on having the EmailAttachment as an interface.

    I'm not really sure how useful this is going to be as you are
going to have to implement quite a few methods.

4. From José Rodolfo Carrijo de Freitas reguarding no arg send()

   This has been added.

5. From Dan via ALR reguarding ordering of the name and address in
contact methods

   I've reordered everything to aways takes Address first and then Name if any.

   to("cody at test.com")
   to("cody at test.com", "Cody")


Thats what I have for now. The one question I have is do we just drop
the ability to do

   to("cody at test.com", "Cody")

and require

  to(new BaseEmailContact("cody at test.com", "Cody")

this would allow a var args address only to/from/cc/bcc/replyTo

Thus you could do:

to("cody at test.com")
to("cody at test.com", "dan at test.com")

but anything with the acutal name would need to be done with

to(new BaseEmailContact("cody at test.com", "Cody")

Of course if people are using existing objects it would be easier to
just implement the EmailContact interface

User user = new User("Cody", "cody at test.com", RoleType.ADMIN);

to(user);

Thoughts?



More information about the seam-dev mailing list