python-amcards 1.7.3__tar.gz → 1.7.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_amcards-1.7.3 → python_amcards-1.7.5}/PKG-INFO +1 -1
- {python_amcards-1.7.3 → python_amcards-1.7.5}/amcards/amcards.py +5 -0
- {python_amcards-1.7.3 → python_amcards-1.7.5}/amcards/models.py +9 -6
- {python_amcards-1.7.3 → python_amcards-1.7.5}/python_amcards.egg-info/PKG-INFO +1 -1
- {python_amcards-1.7.3 → python_amcards-1.7.5}/setup.py +1 -1
- {python_amcards-1.7.3 → python_amcards-1.7.5}/LICENSE +0 -0
- {python_amcards-1.7.3 → python_amcards-1.7.5}/README.rst +0 -0
- {python_amcards-1.7.3 → python_amcards-1.7.5}/amcards/__helpers.py +0 -0
- {python_amcards-1.7.3 → python_amcards-1.7.5}/amcards/__init__.py +0 -0
- {python_amcards-1.7.3 → python_amcards-1.7.5}/amcards/exceptions.py +0 -0
- {python_amcards-1.7.3 → python_amcards-1.7.5}/python_amcards.egg-info/SOURCES.txt +0 -0
- {python_amcards-1.7.3 → python_amcards-1.7.5}/python_amcards.egg-info/dependency_links.txt +0 -0
- {python_amcards-1.7.3 → python_amcards-1.7.5}/python_amcards.egg-info/requires.txt +0 -0
- {python_amcards-1.7.3 → python_amcards-1.7.5}/python_amcards.egg-info/top_level.txt +0 -0
- {python_amcards-1.7.3 → python_amcards-1.7.5}/setup.cfg +0 -0
|
@@ -902,6 +902,7 @@ class AMcardsClient:
|
|
|
902
902
|
return_address: dict = None,
|
|
903
903
|
send_date: str = None,
|
|
904
904
|
extra_data: dict = None,
|
|
905
|
+
bypass_duplicate_check: bool = False,
|
|
905
906
|
) -> CampaignResponse:
|
|
906
907
|
"""Attempt to send a drip campaign.
|
|
907
908
|
|
|
@@ -978,6 +979,7 @@ class AMcardsClient:
|
|
|
978
979
|
'carMake': 'Honda', # OPTIONAL
|
|
979
980
|
}
|
|
980
981
|
|
|
982
|
+
:param bool bypass_duplicate_check: When ``True``, instruct AMcards to bypass duplicate detection for the campaign send; defaults to ``False``.
|
|
981
983
|
:return: AMcards' :py:class:`response <amcards.models.CampaignResponse>` for sending a single drip campaign.
|
|
982
984
|
:rtype: :py:class:`CampaignResponse <amcards.models.CampaignResponse>`
|
|
983
985
|
|
|
@@ -1039,6 +1041,9 @@ class AMcardsClient:
|
|
|
1039
1041
|
if extra_data is not None:
|
|
1040
1042
|
body |= {'extra_data': extra_data}
|
|
1041
1043
|
|
|
1044
|
+
if bypass_duplicate_check:
|
|
1045
|
+
body |= {'bypass_duplicate_check': True}
|
|
1046
|
+
|
|
1042
1047
|
res = requests.post(f'{DOMAIN}/campaigns/open-campaign-form/', json=body, headers=self._HEADERS)
|
|
1043
1048
|
|
|
1044
1049
|
# Check for errors
|
|
@@ -888,7 +888,7 @@ class CampaignMultiResponse:
|
|
|
888
888
|
"""Represents AMcards' response for sending a drip campaign to multiple contacts."""
|
|
889
889
|
def __init__(
|
|
890
890
|
self,
|
|
891
|
-
mailing_id: int,
|
|
891
|
+
mailing_id: Optional[int],
|
|
892
892
|
contacts_scheduled_count: int,
|
|
893
893
|
duplicate_contacts_count: int,
|
|
894
894
|
contacts_scheduled_third_party_contact_ids: List[str],
|
|
@@ -903,13 +903,15 @@ class CampaignMultiResponse:
|
|
|
903
903
|
__repr__ = helpers.repr
|
|
904
904
|
|
|
905
905
|
@property
|
|
906
|
-
def mailing_id(self) -> int:
|
|
907
|
-
"""Unique id for the :py:class:`mailing <amcards.models.Mailing>` created."""
|
|
906
|
+
def mailing_id(self) -> Optional[int]:
|
|
907
|
+
"""Unique id for the :py:class:`mailing <amcards.models.Mailing>` created, if returned."""
|
|
908
908
|
return self._mailing_id
|
|
909
909
|
|
|
910
910
|
@property
|
|
911
|
-
def mailing_link(self) -> str:
|
|
912
|
-
"""This is the link to the mailing list inside of AMcards.com."""
|
|
911
|
+
def mailing_link(self) -> Optional[str]:
|
|
912
|
+
"""This is the link to the mailing list inside of AMcards.com, if available."""
|
|
913
|
+
if self._mailing_id is None:
|
|
914
|
+
return None
|
|
913
915
|
return f'https://amcards.com/cards/history/?mailing={self._mailing_id}'
|
|
914
916
|
|
|
915
917
|
@property
|
|
@@ -934,8 +936,9 @@ class CampaignMultiResponse:
|
|
|
934
936
|
|
|
935
937
|
@classmethod
|
|
936
938
|
def _from_json(cls, json: dict):
|
|
939
|
+
mailing_id = json.get('mailing_id')
|
|
937
940
|
return cls(
|
|
938
|
-
mailing_id=
|
|
941
|
+
mailing_id=int(mailing_id) if mailing_id is not None else None,
|
|
939
942
|
contacts_scheduled_count=json['contacts_scheduled_count'],
|
|
940
943
|
duplicate_contacts_count=json['duplicate_contacts_count'],
|
|
941
944
|
contacts_scheduled_third_party_contact_ids=json['contacts_scheduled_third_party_contact_ids'],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|