from plone import api
from ploneintranet.notifications.browser.aggregator import AggregatedBase


class AggregatedEmail(AggregatedBase):
    """This will send the notifications to the recipient"""

    view_name = "aggregated-email"

    def process(self):
        api.content.get_view(
            name=self.view_name,
            context=self.context,
            request=self.request,
        ).send_email()


class DigestEmail(AggregatedEmail):
    view_name = "digest-email"
