handle map or list parameters
This commit is contained in:
parent
70b2d3ab3c
commit
4f0c06ca53
@ -148,11 +148,15 @@ class SESBackend(BaseBackend):
|
|||||||
def __type_of_message__(self, destinations):
|
def __type_of_message__(self, destinations):
|
||||||
"""Checks the destination for any special address that could indicate delivery,
|
"""Checks the destination for any special address that could indicate delivery,
|
||||||
complaint or bounce like in SES simulator"""
|
complaint or bounce like in SES simulator"""
|
||||||
|
if isinstance(destinations, list):
|
||||||
|
alladdress = destinations
|
||||||
|
else:
|
||||||
alladdress = (
|
alladdress = (
|
||||||
destinations.get("ToAddresses", [])
|
destinations.get("ToAddresses", [])
|
||||||
+ destinations.get("CcAddresses", [])
|
+ destinations.get("CcAddresses", [])
|
||||||
+ destinations.get("BccAddresses", [])
|
+ destinations.get("BccAddresses", [])
|
||||||
)
|
)
|
||||||
|
|
||||||
for addr in alladdress:
|
for addr in alladdress:
|
||||||
if SESFeedback.SUCCESS_ADDR in addr:
|
if SESFeedback.SUCCESS_ADDR in addr:
|
||||||
return SESFeedback.DELIVERY
|
return SESFeedback.DELIVERY
|
||||||
|
Loading…
Reference in New Issue
Block a user