Scaffold containerized Django/Wagtail app with core features
This commit is contained in:
23
apps/newsletter/services.py
Normal file
23
apps/newsletter/services.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ProviderSyncError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class ProviderSyncService:
|
||||
def sync(self, subscription):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class ButtondownSyncService(ProviderSyncService):
|
||||
def sync(self, subscription):
|
||||
logger.info("Synced subscription %s", subscription.email)
|
||||
|
||||
|
||||
def get_provider_service() -> ProviderSyncService:
|
||||
return ButtondownSyncService()
|
||||
Reference in New Issue
Block a user