On Sun, Feb 27, 2011 at 18:22, Cody Lerum <cody.lerum(a)gmail.com> wrote:
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());
Excellent.
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...
Good thinking! I like it.
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")
What about assuming that if there are exactly two arguments, and the second
argument is not an e-mail address, then you assume it's the name part for
the preceding. I know that's there's a hint of guesswork in there, but it
nicely caters to the prototype use case and likely will be appreciate to
"just work".
Example:
to("john.smith(a)acme.com", "joe.cool(a)peanuts.org",
"john.doe(a)example.org") ->
3 recipients
to("john.smith(a)acme.com", "joe.cool(a)peanuts.org") -> 2 recipients
to("john.smith(a)acme.com", "John Smith") -> 1 recipients
You can use a regular expression to check for an e-mail address in the
second argument position, so long as you make it a configurable setting.
Keep in mind you can already do (if I'm not mistaken):
to("John Smith <john.smith(a)acme.com>", "Joe Cool
<joe.cool(a)peanuts.org>")
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);
But you are right, there are plenty of other options. I think it's safe to
treat the two argument invocation as a special case.
-Dan
--
Dan Allen
Principal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597
http://www.google.com/profiles/dan.j.allen#about
http://mojavelinux.com
http://mojavelinux.com/seaminaction