Interface NewsletterEmailService


  • public interface NewsletterEmailService
    • Method Detail

      • 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:
        java.security.AccessControlException - if the Session lacks the privilege to send
        RepositoryException - in case of error accessing the Repository
      • 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,
                                   java.net.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)
      • createMailingList

        AuthorizableMailingList createMailingList​(java.lang.String groupName,
                                                  Session session)
                                           throws RepositoryException
        Build a MailingList for the given group-name
        Parameters:
        groupName - to build a MailingList for
        session - 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 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