<div class="gmail_quote">On Sun, Feb 27, 2011 at 18:22, Cody Lerum <span dir="ltr">&lt;<a href="mailto:cody.lerum@gmail.com">cody.lerum@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

1. From Lincoln<br>
<br>
Utilizing an Interface for handling the different ways one could<br>
create an email template. -<br>
<a href="https://issues.jboss.org/browse/SEAMMAIL-19" target="_blank">https://issues.jboss.org/browse/SEAMMAIL-19</a><br>
<br>
    This is Done.<br>
<br>
VelocityMailMessage vmm = velocityMailMessage.get();<br>
<br>
      vmm.from(&quot;seam@test.test&quot;, &quot;Seam Framework&quot;)<br>
            .to(person)<br>
            .subject(&quot;HTML Message from Seam Mail - &quot; +<br>
java.util.UUID.randomUUID().toString())<br>
            .bodyHtml(new VelocityClassPathTemplate(&quot;template.html.vm&quot;))<br>
            .put(&quot;version&quot;, &quot;Seam 3&quot;)<br>
            .importance(MessagePriority.HIGH)<br>
            vmm.send(session.get());<br></blockquote><div><br></div><div>Excellent.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
   the contact fields also support a interface as well so one only<br>
need implement a getName and getAddress method on their User entity<br>
(for example) in order to pass it directly into an email -<br>
<a href="https://github.com/seam/mail/blob/6f70057cca7da712576c21f44bda80082ae1f0a1/examples/sendmail/src/main/java/org/jboss/seam/mail/example/Person.java" target="_blank">https://github.com/seam/mail/blob/6f70057cca7da712576c21f44bda80082ae1f0a1/examples/sendmail/src/main/java/org/jboss/seam/mail/example/Person.java</a></blockquote>

<div><br></div><div>Good thinking! I like it.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
5. From Dan via ALR reguarding ordering of the name and address in<br>
contact methods<br>
<br>
   I&#39;ve reordered everything to aways takes Address first and then Name if any.<br>
<br>
   to(&quot;<a href="mailto:cody@test.com">cody@test.com</a>&quot;)<br>
   to(&quot;<a href="mailto:cody@test.com">cody@test.com</a>&quot;, &quot;Cody&quot;)<br>
<br>
<br>
Thats what I have for now. The one question I have is do we just drop<br>
the ability to do<br>
<br>
   to(&quot;<a href="mailto:cody@test.com">cody@test.com</a>&quot;, &quot;Cody&quot;)<br>
<br>
and require<br>
<br>
  to(new BaseEmailContact(&quot;<a href="mailto:cody@test.com">cody@test.com</a>&quot;, &quot;Cody&quot;)<br>
<br>
this would allow a var args address only to/from/cc/bcc/replyTo<br>
<br>
Thus you could do:<br>
<br>
to(&quot;<a href="mailto:cody@test.com">cody@test.com</a>&quot;)<br>
to(&quot;<a href="mailto:cody@test.com">cody@test.com</a>&quot;, &quot;<a href="mailto:dan@test.com">dan@test.com</a>&quot;)<br>
<br>
but anything with the acutal name would need to be done with<br>
<br>
to(new BaseEmailContact(&quot;<a href="mailto:cody@test.com">cody@test.com</a>&quot;, &quot;Cody&quot;)<br></blockquote><div><br></div><div>What about assuming that if there are exactly two arguments, and the second argument is not an e-mail address, then you assume it&#39;s the name part for the preceding. I know that&#39;s there&#39;s a hint of guesswork in there, but it nicely caters to the prototype use case and likely will be appreciate to &quot;just work&quot;.</div>

<div><br></div><div>Example:</div><div><br></div><div>to(&quot;<a href="mailto:john.smith@acme.com">john.smith@acme.com</a>&quot;, &quot;<a href="mailto:joe.cool@peanuts.org">joe.cool@peanuts.org</a>&quot;, &quot;<a href="mailto:john.doe@example.org">john.doe@example.org</a>&quot;) -&gt; 3 recipients</div>

<div><meta http-equiv="content-type" content="text/html; charset=utf-8">to(&quot;<a href="mailto:john.smith@acme.com">john.smith@acme.com</a>&quot;, &quot;<a href="mailto:joe.cool@peanuts.org">joe.cool@peanuts.org</a>&quot;) -&gt; 2 recipients</div>

<div><meta http-equiv="content-type" content="text/html; charset=utf-8">to(&quot;<a href="mailto:john.smith@acme.com">john.smith@acme.com</a>&quot;, &quot;John Smith&quot;) -&gt; 1 recipients</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>

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.</div></div><div><br></div><div>Keep in mind you can already do (if I&#39;m not mistaken):</div>

<div><br></div><div>to(&quot;John Smith &lt;<a href="mailto:john.smith@acme.com">john.smith@acme.com</a>&gt;&quot;, &quot;Joe Cool &lt;<a href="mailto:joe.cool@peanuts.org">joe.cool@peanuts.org</a>&gt;&quot;)</div><div><br>

</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Of course if people are using existing objects it would be easier to<br>
just implement the EmailContact interface<br>
<br>
User user = new User(&quot;Cody&quot;, &quot;<a href="mailto:cody@test.com">cody@test.com</a>&quot;, RoleType.ADMIN);<br></blockquote><div><br></div><div>But you are right, there are plenty of other options. I think it&#39;s safe to treat the two argument invocation as a special case.</div>

<div><br></div><div>-Dan</div><div><br></div></div>-- <br><div>Dan Allen</div>Principal Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><div><a href="http://www.google.com/profiles/dan.j.allen#about" target="_blank">http://www.google.com/profiles/dan.j.allen#about</a><br>

<a href="http://mojavelinux.com" target="_blank">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction" target="_blank">http://mojavelinux.com/seaminaction</a><br></div><br>