mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Brevo: SendinBlue compatibility
(See previous commit.) - Maintain deprecated compatibility versions on the old names/URLs. (Split into separate commit to make renamed files more obvious.)
This commit is contained in:
20
anymail/backends/sendinblue.py
Normal file
20
anymail/backends/sendinblue.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import warnings
|
||||
|
||||
from ..exceptions import AnymailDeprecationWarning
|
||||
from .brevo import EmailBackend as BrevoEmailBackend
|
||||
|
||||
|
||||
class EmailBackend(BrevoEmailBackend):
|
||||
"""
|
||||
Deprecated compatibility backend for old Brevo name "SendinBlue".
|
||||
"""
|
||||
|
||||
esp_name = "SendinBlue"
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
warnings.warn(
|
||||
"`anymail.backends.sendinblue.EmailBackend` has been renamed"
|
||||
" `anymail.backends.brevo.EmailBackend`.",
|
||||
AnymailDeprecationWarning,
|
||||
)
|
||||
super().__init__(**kwargs)
|
||||
@@ -16,6 +16,10 @@ from .webhooks.postal import PostalInboundWebhookView, PostalTrackingWebhookView
|
||||
from .webhooks.postmark import PostmarkInboundWebhookView, PostmarkTrackingWebhookView
|
||||
from .webhooks.resend import ResendTrackingWebhookView
|
||||
from .webhooks.sendgrid import SendGridInboundWebhookView, SendGridTrackingWebhookView
|
||||
from .webhooks.sendinblue import (
|
||||
SendinBlueInboundWebhookView,
|
||||
SendinBlueTrackingWebhookView,
|
||||
)
|
||||
from .webhooks.sparkpost import (
|
||||
SparkPostInboundWebhookView,
|
||||
SparkPostTrackingWebhookView,
|
||||
@@ -68,6 +72,12 @@ urlpatterns = [
|
||||
SendGridInboundWebhookView.as_view(),
|
||||
name="sendgrid_inbound_webhook",
|
||||
),
|
||||
path(
|
||||
# Compatibility for old SendinBlue esp_name; use Brevo in new code
|
||||
"sendinblue/inbound/",
|
||||
SendinBlueInboundWebhookView.as_view(),
|
||||
name="sendinblue_inbound_webhook",
|
||||
),
|
||||
path(
|
||||
"sparkpost/inbound/",
|
||||
SparkPostInboundWebhookView.as_view(),
|
||||
@@ -118,6 +128,12 @@ urlpatterns = [
|
||||
SendGridTrackingWebhookView.as_view(),
|
||||
name="sendgrid_tracking_webhook",
|
||||
),
|
||||
path(
|
||||
# Compatibility for old SendinBlue esp_name; use Brevo in new code
|
||||
"sendinblue/tracking/",
|
||||
SendinBlueTrackingWebhookView.as_view(),
|
||||
name="sendinblue_tracking_webhook",
|
||||
),
|
||||
path(
|
||||
"sparkpost/tracking/",
|
||||
SparkPostTrackingWebhookView.as_view(),
|
||||
|
||||
38
anymail/webhooks/sendinblue.py
Normal file
38
anymail/webhooks/sendinblue.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import warnings
|
||||
|
||||
from ..exceptions import AnymailDeprecationWarning
|
||||
from .brevo import BrevoInboundWebhookView, BrevoTrackingWebhookView
|
||||
|
||||
|
||||
class SendinBlueTrackingWebhookView(BrevoTrackingWebhookView):
|
||||
"""
|
||||
Deprecated compatibility tracking webhook for old Brevo name "SendinBlue".
|
||||
"""
|
||||
|
||||
esp_name = "SendinBlue"
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
warnings.warn(
|
||||
"Anymail's SendinBlue webhook URLs are deprecated."
|
||||
" Update your Brevo transactional email webhook URL to change"
|
||||
" 'anymail/sendinblue' to 'anymail/brevo'.",
|
||||
AnymailDeprecationWarning,
|
||||
)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
|
||||
class SendinBlueInboundWebhookView(BrevoInboundWebhookView):
|
||||
"""
|
||||
Deprecated compatibility inbound webhook for old Brevo name "SendinBlue".
|
||||
"""
|
||||
|
||||
esp_name = "SendinBlue"
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
warnings.warn(
|
||||
"Anymail's SendinBlue webhook URLs are deprecated."
|
||||
" Update your Brevo inbound webhook URL to change"
|
||||
" 'anymail/sendinblue' to 'anymail/brevo'.",
|
||||
AnymailDeprecationWarning,
|
||||
)
|
||||
super().__init__(**kwargs)
|
||||
Reference in New Issue
Block a user