public interface NewsletterService
| Modifier and Type | Method and Description |
|---|---|
void |
bounced(Authorizable authorizable,
java.lang.String bouncedMailPath,
Session session)
Marks a newsletter bounce.
|
NewsLetter |
buildNewsletter(Page page)
Builds a
Newsletter from the given Page.The Page is considered to represent the content of the Newsletter Its up to the implementation what are the preconditions on processing the Page. |
NewsLetter |
buildNewsletter(Resource resource,
java.net.URI contentUri)
Builds a Newsletter and take the URI to retrieve the content.
|
MailingList |
createMailingList(java.lang.String groupName,
Session session)
Build a MailingList for the given group-name
|
MailingList |
createTestMailingList(SlingHttpServletRequest request)
Create a MailingList for testing.
|
boolean |
hasNewsletterBounced(Authorizable authorizable,
Session session)
Tests if the authorizable's newsletter bounce counter exceeded.
|
void |
processBounceCounter(Authorizable authorizable,
boolean increase,
Session session)
Process the authorizable's bounce counter.
|
MailingStatus |
sendNewsletter(NewsLetter newsletter)
Send the newsletter.
|
MailingStatus sendNewsletter(NewsLetter newsletter) throws RepositoryException
newsletter - The newslettertruefalse
otherwise.java.security.AccessControlException - if the Session lacks the privilege to sendjavax.jcr.RepositoryException - in case of error accessing the RepositoryRepositoryExceptionNewsLetter buildNewsletter(Page page) throws RepositoryException
Newsletter from the given Page.page - containing the data of the Newsletternull if the Resource is
not suited to build a NewsletterRepositoryException - in case of Exception accessing the RepositoryNewsLetter buildNewsletter(Resource resource, java.net.URI contentUri) throws RepositoryException
resource - to build Newsletter ofcontentUri - to take as host information to be shown in sent NewsletterRepositoryException - in case of error accessing the RepositorybuildNewsletter(Page)MailingList createMailingList(java.lang.String groupName, Session session) throws NoSuchAuthorizableException, RepositoryException
groupName - to build a MailingList forsession - to retrieve the ListNoSuchAuthorizableException - if the group-name is not foundRepositoryException - in case of error accessing the RepositoryMailingList createTestMailingList(SlingHttpServletRequest request) throws RepositoryException
User to an e-mail
address to send the mail to. The Address has to be given with the
RequestParameter NewsletterHelper.PARAM_TEST_TO or defaults to
the Request's User's
Profile.getPrimaryMail() primary
Mail} (e.g. ResourceResolver.adaptTo(User.class)). The Profile has to be
given by the RequestParameter named
NewsletterHelper.PARAM_TEST_PROFILE and the Id as value.request - to read the input fromnull if
parameters are not setRepositoryException - in case of error accessing the Repositoryvoid bounced(Authorizable authorizable, java.lang.String bouncedMailPath, Session session) throws RepositoryException
authorizable - The authorizable to mark the newsletter bounce for.bouncedMailPath - Path to the mail that bounced.session - The JCR Session to use.RepositoryExceptionboolean hasNewsletterBounced(Authorizable authorizable, Session session) throws RepositoryException
authorizable - The authorizable to test for.session - The JCR session to use.RepositoryExceptionvoid processBounceCounter(Authorizable authorizable, boolean increase, Session session) throws RepositoryException
authorizable - The authorizable to process the bounce counter of.increase - If true increase the bounce counter, decrease
otherwise.session - The JCR Session to use.RepositoryException