Package org.intermine.util
Class Emailer
- java.lang.Object
-
- org.intermine.util.Emailer
-
- Direct Known Subclasses:
NullMailer
public class Emailer extends java.lang.Object
A class that will send emails to people.- Author:
- Alex Kalderimis
-
-
Constructor Summary
Constructors Constructor Description Emailer(java.util.Properties properties)
Instantiate an emailer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
email(java.lang.String to, java.lang.String messageKey)
Send a message to a user.void
email(java.lang.String to, java.lang.String messageKey, java.lang.Object... vars)
Send a message to a user with some data.void
informUserOfNewSharedBag(java.lang.String to, Profile owner, InterMineBag bag)
Send a 'sharing list' messagevoid
sendFareWell(java.lang.String address, java.lang.String xml)
Bid a user farewell from the system.java.lang.String
subscribeToList(java.lang.String address)
Subscribe a user to a mailing list.void
welcome(java.lang.String to)
Welcome a user to the system.
-
-
-
Method Detail
-
email
public void email(java.lang.String to, java.lang.String messageKey) throws javax.mail.MessagingException
Send a message to a user.- Parameters:
to
- The recipientmessageKey
- The key for the message.- Throws:
javax.mail.MessagingException
- if something goes wrong.
-
email
public void email(java.lang.String to, java.lang.String messageKey, java.lang.Object... vars) throws javax.mail.MessagingException
Send a message to a user with some data.- Parameters:
to
- The recipient.messageKey
- The message key.vars
- The data.- Throws:
javax.mail.MessagingException
- If something goes wrong.
-
welcome
public void welcome(java.lang.String to) throws javax.mail.MessagingException
Welcome a user to the system.- Parameters:
to
- The new user.- Throws:
javax.mail.MessagingException
- If something goes wrong.
-
sendFareWell
public void sendFareWell(java.lang.String address, java.lang.String xml) throws javax.mail.MessagingException
Bid a user farewell from the system.- Parameters:
address
- The former user.xml
- All the user's stuff.- Throws:
javax.mail.MessagingException
- If something goes wrong.
-
subscribeToList
public java.lang.String subscribeToList(java.lang.String address) throws javax.mail.MessagingException
Subscribe a user to a mailing list.- Parameters:
address
- The address to subscribe.- Returns:
- The address of the mailing list.
- Throws:
javax.mail.MessagingException
- if something goes wrong.
-
informUserOfNewSharedBag
public void informUserOfNewSharedBag(java.lang.String to, Profile owner, InterMineBag bag) throws javax.mail.MessagingException, ObjectStoreException, java.io.UnsupportedEncodingException
Send a 'sharing list' message- Parameters:
to
- the address to send toowner
- the user sharing the listbag
- the list shared- Throws:
javax.mail.MessagingException
- if there is a problem creating the emailObjectStoreException
- if the bag cannot read its sizejava.io.UnsupportedEncodingException
- If UTF-8 is not supported.
-
-