org.views.newsletter
The newsletter view.
Functions
|
|
Retrieves a list of news items associated with a specific newsletter |
|
Retrieves a list of news items associated with a specific newsletter |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module Contents
- org.views.newsletter.get_newsletter_form(model: onegov.newsletter.Newsletter, request: onegov.org.request.OrgRequest) → type[onegov.org.forms.NewsletterForm][source]
- org.views.newsletter.newsletter_news_by_access(newsletter: onegov.newsletter.Newsletter, request: onegov.org.request.OrgRequest, access: str = 'public') → list[onegov.org.models.News] | None[source]
Retrieves a list of news items associated with a specific newsletter based on the given access level or higher. This function is used for the newsletter preview as well as for sending newsletters.
The function filters the news items based on their access level (‘public’, ‘secret’, ‘private’) and whether they are published. It then orders the news items in descending order by their creation date.
Returns: - list[News] | None: A list of news items that match the provided access level. If no news items are found, None is returned.
Raises: - ValueError: If an invalid access level is provided.
- org.views.newsletter.visible_news_by_newsletter(newsletter: onegov.newsletter.Newsletter, request: onegov.org.request.OrgRequest) → list[onegov.org.models.News] | None[source]
Retrieves a list of news items associated with a specific newsletter visible to the current user.
- org.views.newsletter.occurrences_by_newsletter(newsletter: onegov.newsletter.Newsletter, request: onegov.org.request.OrgRequest) → Query[Occurrence] | None[source]
- org.views.newsletter.publications_by_newsletter(newsletter: onegov.newsletter.Newsletter, request: onegov.org.request.OrgRequest) → Query[File] | None[source]
- org.views.newsletter.handle_newsletters(self: onegov.newsletter.NewsletterCollection, request: onegov.org.request.OrgRequest, form: onegov.org.forms.SignupForm, layout: onegov.org.layout.NewsletterLayout | None = None, mail_layout: onegov.org.layout.DefaultMailLayout | None = None, title: str = '', update: bool = False) → RenderData | Response[source]
- org.views.newsletter.handle_update_newsletters_subscription(self: onegov.newsletter.NewsletterCollection, request: onegov.org.request.OrgRequest, form: onegov.org.forms.SignupForm, layout: onegov.org.layout.NewsletterLayout | None = None, mail_layout: onegov.org.layout.DefaultMailLayout | None = None) → RenderData | Response[source]
- org.views.newsletter.view_newsletter(self: onegov.newsletter.Newsletter, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.NewsletterLayout | None = None) → onegov.core.types.RenderData[source]
- org.views.newsletter.view_subscribers(self: onegov.newsletter.RecipientCollection, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.RecipientLayout | None = None) → onegov.core.types.RenderData[source]
- org.views.newsletter.handle_new_newsletter(self: onegov.newsletter.NewsletterCollection, request: onegov.org.request.OrgRequest, form: onegov.org.forms.NewsletterForm, layout: onegov.org.layout.NewsletterLayout | None = None) → RenderData | Response[source]
- org.views.newsletter.edit_newsletter(self: onegov.newsletter.Newsletter, request: onegov.org.request.OrgRequest, form: onegov.org.forms.NewsletterForm, layout: onegov.org.layout.NewsletterLayout | None = None) → RenderData | Response[source]
- org.views.newsletter.delete_newsletter(self: onegov.newsletter.Newsletter, request: onegov.org.request.OrgRequest) → None[source]
- org.views.newsletter.send_newsletter(request: onegov.org.request.OrgRequest, newsletter: onegov.newsletter.Newsletter, recipients: Iterable[Recipient], is_test: bool = False, layout: onegov.org.layout.DefaultMailLayout | None = None) → int[source]
- org.views.newsletter.handle_send_newsletter(self: onegov.newsletter.Newsletter, request: onegov.org.request.OrgRequest, form: onegov.org.forms.NewsletterSendForm, layout: onegov.org.layout.NewsletterLayout | None = None) → RenderData | Response[source]
- org.views.newsletter.handle_test_newsletter(self: onegov.newsletter.Newsletter, request: onegov.org.request.OrgRequest, form: onegov.org.forms.NewsletterTestForm, layout: onegov.org.layout.NewsletterLayout | None = None) → RenderData | Response[source]
- org.views.newsletter.handle_preview_newsletter(self: onegov.newsletter.Newsletter, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.DefaultMailLayout | None = None) → onegov.core.types.RenderData[source]