Skip to content

Commit

Permalink
update pom
Browse files Browse the repository at this point in the history
add put method
  • Loading branch information
codylerum committed Mar 17, 2011
1 parent 8617161 commit bded2e2
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 13 deletions.
Expand Up @@ -20,6 +20,7 @@
import java.io.File;
import java.io.InputStream;
import java.util.Collection;
import java.util.Map;

import javax.mail.Session;
import javax.mail.internet.InternetAddress;
Expand Down Expand Up @@ -449,4 +450,11 @@ public interface MailMessage
* @param value the Object being placed in the context
*/
public MailMessage put(String name, Object value);

/**
* Places a Map of variable in the templating engines context
*
* @param values Map<String, Object> containing the variables to be placed in the context
*/
public MailMessage put(Map<String, Object> values);
}
Expand Up @@ -348,6 +348,12 @@ public MailMessage put(String key, Object value)
templateContext.put(key, value);
return this;
}

public MailMessage put(Map<String, Object> values)
{
templateContext.putAll(values);
return this;
}

public EmailMessage getEmailMessage()
{
Expand Down
Expand Up @@ -68,7 +68,7 @@ public void sendText()
.from("seam@test.test", "Seam Framework")
.to( person.getEmail(), person.getName())
.subject("Text Message from Seam Mail - " + java.util.UUID.randomUUID().toString())
.textBody(text)
.bodyText(text)
.send();
}

Expand Down
Expand Up @@ -123,7 +123,7 @@ public void testTextMailMessage() throws MessagingException, IOException
.replyTo(replyToAddress)
.to(toAddress, toName)
.subject(subject)
.textBody(textBody)
.bodyText(textBody)
.importance(MessagePriority.HIGH)
.messageId(messageId)
.send(session.get());
Expand Down Expand Up @@ -180,7 +180,7 @@ public void testHTMLMailMessage() throws MessagingException, IOException
.replyTo(replyToAddress, replyToName)
.to(person.getEmail(), person.getName())
.subject(subject)
.htmlBody(htmlBody)
.bodyHtml(htmlBody)
.importance(MessagePriority.HIGH)
.addAttachment(new URLAttachment("http://www.seamframework.org/themes/sfwkorg/img/seam_icon_large.png", "seamLogo.png", ContentDisposition.INLINE)).send(session.get());
}
Expand Down Expand Up @@ -242,7 +242,7 @@ public void testHTMLTextAltMailMessage() throws MessagingException, IOException
.from(fromAddress, fromName)
.to(person.getEmail(), person.getName())
.subject(subject)
.htmlBodyTextAlt(htmlBody, textBody)
.bodyHtmlTextAlt(htmlBody, textBody)
.importance(MessagePriority.LOW)
.deliveryReceipt(fromAddress)
.readReceipt("seam.test")
Expand Down Expand Up @@ -323,7 +323,7 @@ public void testTextMailMessageLongFields() throws MessagingException, IOExcepti
.to(longToAddress, longToName)
.cc(longCcAddress, longCcName)
.subject(subject)
.textBody(textBody)
.bodyText(textBody)
.importance(MessagePriority.HIGH)
.send(session.get());
}
Expand Down Expand Up @@ -375,7 +375,7 @@ public void testTextMailMessageSendFailed()
person.setName(toName);
person.setEmail(toAddress);

mailMessage.get().from(fromAddress, fromName).replyTo(replyToAddress).to(toAddress, toName).subject(subject).textBody(textBody).importance(MessagePriority.HIGH).messageId(messageId).send(session.get());
mailMessage.get().from(fromAddress, fromName).replyTo(replyToAddress).to(toAddress, toName).subject(subject).bodyText(textBody).importance(MessagePriority.HIGH).messageId(messageId).send(session.get());
}
finally
{
Expand Down Expand Up @@ -403,7 +403,7 @@ public void testTextMailMessageInvalidAddress() throws SendFailedException
person.setName(toName);
person.setEmail(toAddress);

mailMessage.get().from("seam seamerson@test.com", fromName).replyTo(replyToAddress).to(toAddress, toName).subject(subject).textBody(textBody).importance(MessagePriority.HIGH).messageId(messageId).send(session.get());
mailMessage.get().from("seam seamerson@test.com", fromName).replyTo(replyToAddress).to(toAddress, toName).subject(subject).bodyText(textBody).importance(MessagePriority.HIGH).messageId(messageId).send(session.get());
}
finally
{
Expand Down Expand Up @@ -434,7 +434,7 @@ public void testTextMailMessageUsingPerson() throws MessagingException, IOExcept
.replyTo(replyToAddress)
.to(person)
.subject(subject)
.textBody(textBody)
.bodyText(textBody)
.importance(MessagePriority.HIGH)
.messageId(messageId)
.send(session.get());
Expand Down Expand Up @@ -491,7 +491,7 @@ public void testTextMailMessageUsingDefaultSession() throws MessagingException,
.replyTo(replyToAddress)
.to(person)
.subject(subject)
.textBody(textBody)
.bodyText(textBody)
.importance(MessagePriority.HIGH)
.messageId(messageId)
.send();
Expand Down
30 changes: 26 additions & 4 deletions pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>seam-parent</artifactId>
<groupId>org.jboss.seam</groupId>
<version>8</version>
<version>9</version>
</parent>

<groupId>org.jboss.seam.mail</groupId>
Expand All @@ -14,7 +14,8 @@
<name>Seam Mail Module</name>

<properties>
<seam.version>3.0.0.b09</seam.version>
<seam.version>3.0.0-SNAPSHOT</seam.version>
<jboss.javaee.version>1.0.0.Final</jboss.javaee.version>
</properties>

<modules>
Expand Down Expand Up @@ -44,7 +45,7 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.jboss.seam.mail</groupId>
<artifactId>seam-mail-core-impl</artifactId>
Expand All @@ -58,7 +59,7 @@
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.jboss.seam.mail</groupId>
<artifactId>seam-mail-render-impl</artifactId>
Expand All @@ -72,7 +73,28 @@
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>

<!-- import the individual Java EE 6 API spec versions -->
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>${jboss.javaee.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>

<!-- make Java EE 6 API available as stack artifact -->
<!-- yes, we really need this one too! -->
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>${jboss.javaee.version}</version>
<scope>provided</scope>
<type>pom</type>
</dependency>

</dependencies>

</dependencyManagement>

<!-- Dependencies common to the api and implementation(s) -->
Expand Down

0 comments on commit bded2e2

Please sign in to comment.