Interface NewsletterEmailService


  • public interface NewsletterEmailService
    • Method Detail

      • buildNewsletter

        NewsLetter buildNewsletter​(Page page)
                            throws RepositoryException
        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.
        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

        NewsLetter buildNewsletter​(Resource resource,
                                   URI contentUri)
                            throws RepositoryException
        Builds a Newsletter and take the URI to retrieve the content.
        Parameters:
        resource - to build Newsletter of
        contentUri - 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:
        buildNewsletter(Page)
      • createTestMailingList

        AuthorizableMailingList createTestMailingList​(SlingHttpServletRequest request)
                                               throws RepositoryException
        Create a MailingList for testing. The aim is to have a Profile to use for personalization and a 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 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.
        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