Files
notifications-api/app/clients/email/__init__.py
Cliff Hill 3ff6d38660 Making the new pinpoint client.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2023-12-29 18:11:55 -05:00

39 lines
1.1 KiB
Python

from abc import abstractmethod, abstractproperty
from app.clients import Client, ClientException
class EmailClientException(ClientException):
"""
Base Exception for EmailClients
"""
pass
class EmailClientNonRetryableException(ClientException):
"""
Represents an error returned from the email client API with a 4xx response code
that should not be retried and should instead be marked as technical failure.
An example of this would be an email address that makes it through our
validation rules but is rejected by SES. There is no point in retrying this type as
it will always fail however many calls to SES. Whereas a throttling error would not
use this exception as it may succeed if we retry
"""
pass
class EmailClient(Client):
"""
Base Email client for sending emails.
"""
@abstractmethod
def send_email(self, *args, **kwargs):
raise NotImplementedError("TODO Need to implement.")
@abstractproperty
def name(self):
raise NotImplementedError("TODO Need to implement.")