com.day.cq.wcm.newsletter
Interface NewsletterService


public interface NewsletterService

The newsletter service can be used to send newsletters or to retrieve information about the subscribers.


Method Summary
 Newsletter getNewsletter(String path, URL contentUrl)
          Create a newsletter object for the given path.
 long getSubscriberCount(String path)
          Deprecated. Use #getNewsletter(String) instead.
 String getSubscriptionPath(org.apache.sling.api.SlingHttpServletRequest request)
          Return the subscription path.
 boolean sendNewsletter(Newsletter newsletter)
          Send the newsletter.
 String sendNewsletter(String path, String subject, String contentUrl)
          Deprecated. Use sendNewsletter(Newsletter) instead.
 

Method Detail

sendNewsletter

@Deprecated
String sendNewsletter(String path,
                                 String subject,
                                 String contentUrl)
                      throws RepositoryException
Deprecated. Use sendNewsletter(Newsletter) instead.

Send the newsletter for the given content

Parameters:
path - The content path
subject - The subject for the newsletter
contentUrl - Used by the mailer to retrieve the content
Returns:
an info message like "12 subscribers, sending newsletter"
Throws:
RepositoryException

getSubscriberCount

@Deprecated
long getSubscriberCount(String path)
                        throws RepositoryException
Deprecated. Use #getNewsletter(String) instead.

Return the number of subscribers.

Parameters:
path - The content path
Returns:
The number of subscribers.
Throws:
RepositoryException

getNewsletter

Newsletter getNewsletter(String path,
                         URL contentUrl)
Create a newsletter object for the given path. The path is used to find out all subscribers whereas the contentUrl is a fully qualified url rendering the content. This allows to render the content on a different machine than sending the mail.

Parameters:
path - The content path.
contentUrl - Used by the mailer to retrieve the content
Returns:
The newsletter object.
Since:
5.2

sendNewsletter

boolean sendNewsletter(Newsletter newsletter)
Send the newsletter.

Parameters:
newsletter - The newsletter
Returns:
truefalse otherwise.
Since:
5.2

getSubscriptionPath

String getSubscriptionPath(org.apache.sling.api.SlingHttpServletRequest request)
Return the subscription path. This method is used by the forms components.

Parameters:
request - The current request.
Returns:
The path or null


Copyright © 2009 Day Management AG. All Rights Reserved.