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(a)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/6f70057cca7da712576c21f44bda80082ae1f0a...
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(a)nothingtosee.org",
"dan(a)test.com") is something we could do, but we would have to ditch
the to("Dan", "dan(a)test.com"). People would have to create personal +
address recipients via something like to(new BaseEmailContact("Dan".
"dan@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(a)test.com")
to("cody(a)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(a)test.com", "Cody")
and require
to(new BaseEmailContact("cody(a)test.com", "Cody")
this would allow a var args address only to/from/cc/bcc/replyTo
Thus you could do:
to("cody(a)test.com")
to("cody(a)test.com", "dan(a)test.com")
but anything with the acutal name would need to be done with
to(new BaseEmailContact("cody(a)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(a)test.com", RoleType.ADMIN);
to(user);
Thoughts?