Package com.day.cq.mcm.api.newsletter
Interface NewsletterEmailService
public interface NewsletterEmailService
-
Method Summary
Modifier and TypeMethodDescriptionbuildNewsletter
(Page page) Builds aNewsletter
from 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.buildNewsletter
(Resource resource, URI contentUri) Builds a Newsletter and take the URI to retrieve the content.createMailingList
(String groupName, Session session) Build a MailingList for the given group-nameCreate a MailingList for testing.sendNewsletter
(NewsLetter newsletter, ResourceResolver resourceResolver) Send the newsletter.
-
Method Details
-
sendNewsletter
MailingStatus sendNewsletter(NewsLetter newsletter, ResourceResolver resourceResolver) throws RepositoryException Send the newsletter.- Parameters:
newsletter
- The newsletter- Returns:
true
if the newsletter could be send;false
otherwise.- Throws:
AccessControlException
- if the Session lacks the privilege to sendRepositoryException
- in case of error accessing the Repository
-
buildNewsletter
Builds aNewsletter
from 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
null
if the Resource is not suited to build a Newsletter - Throws:
RepositoryException
- in case of Exception accessing the Repository
-
buildNewsletter
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:
RepositoryException
- in case of error accessing the Repository- See Also:
-
createMailingList
AuthorizableMailingList createMailingList(String groupName, Session session) throws 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:
RepositoryException
- in case of error accessing the Repository
-
createTestMailingList
AuthorizableMailingList createTestMailingList(SlingHttpServletRequest request) throws RepositoryException Create a MailingList for testing. The aim is to have a Profile to use for personalization and aUser
to an e-mail address to send the mail to. The Address has to be given with the RequestParameterNewsletterHelper.PARAM_TEST_TO
or 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_PROFILE
and the Id as value.- Parameters:
request
- to read the input from- Returns:
- a MailingList with on Recipient or
null
if parameters are not set - Throws:
RepositoryException
- in case of error accessing the Repository
-