Package com.day.cq.mcm.api.newsletter
Interface NewsletterEmailService
-
public interface NewsletterEmailService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NewsLetterbuildNewsletter(Page page)Builds aNewsletterfrom the givenPage.
The Page is considered to represent the content of the Newsletter
Its up to the implementation what are the preconditions on processing the Page.NewsLetterbuildNewsletter(Resource resource, java.net.URI contentUri)Builds a Newsletter and take the URI to retrieve the content.AuthorizableMailingListcreateMailingList(java.lang.String groupName, javax.jcr.Session session)Build a MailingList for the given group-nameAuthorizableMailingListcreateTestMailingList(SlingHttpServletRequest request)Create a MailingList for testing.MailingStatussendNewsletter(NewsLetter newsletter, ResourceResolver resourceResolver)Send the newsletter.
-
-
-
Method Detail
-
sendNewsletter
MailingStatus sendNewsletter(NewsLetter newsletter, ResourceResolver resourceResolver) throws javax.jcr.RepositoryException
Send the newsletter.- Parameters:
newsletter- The newsletter- Returns:
trueif the newsletter could be send;falseotherwise.- Throws:
java.security.AccessControlException- if the Session lacks the privilege to sendjavax.jcr.RepositoryException- in case of error accessing the Repository
-
buildNewsletter
NewsLetter buildNewsletter(Page page) throws javax.jcr.RepositoryException
Builds aNewsletterfrom the givenPage.
The Page is considered to represent the content of the Newsletter
Its up to the implementation what are the preconditions on processing the Page.- Parameters:
page- containing the data of the Newsletter- Returns:
- the Newsletter build maybe
nullif the Resource is not suited to build a Newsletter - Throws:
javax.jcr.RepositoryException- in case of Exception accessing the Repository
-
buildNewsletter
NewsLetter buildNewsletter(Resource resource, java.net.URI contentUri) throws javax.jcr.RepositoryException
Builds a Newsletter and take the URI to retrieve the content.- Parameters:
resource- to build Newsletter ofcontentUri- to take as host information to be shown in sent Newsletter- Returns:
- the Newsletter build
- Throws:
javax.jcr.RepositoryException- in case of error accessing the Repository- See Also:
buildNewsletter(Page)
-
createMailingList
AuthorizableMailingList createMailingList(java.lang.String groupName, javax.jcr.Session session) throws javax.jcr.RepositoryException
Build a MailingList for the given group-name- Parameters:
groupName- to build a MailingList forsession- to retrieve the List- Returns:
- the List build
- Throws:
javax.jcr.RepositoryException- in case of error accessing the Repository
-
createTestMailingList
AuthorizableMailingList createTestMailingList(SlingHttpServletRequest request) throws javax.jcr.RepositoryException
Create a MailingList for testing. The aim is to have a Profile to use for personalization and aUserto an e-mail address to send the mail to. The Address has to be given with the RequestParameterNewsletterHelper.PARAM_TEST_TOor defaults to the Request's User's primary Mail (e.g. ResourceResolver.adaptTo(User.class)). The Profile has to be given by the RequestParameter namedNewsletterHelper.PARAM_TEST_PROFILEand the Id as value.- Parameters:
request- to read the input from- Returns:
- a MailingList with on Recipient or
nullif parameters are not set - Throws:
javax.jcr.RepositoryException- in case of error accessing the Repository
-
-