Skip to content

Commit

Permalink
Merge pull request #30 from industrydive/SR-1807-blast-type-criteria-…
Browse files Browse the repository at this point in the history
…update

ENGA-633 blast type criteria update
  • Loading branch information
echan217 authored Jun 7, 2023
2 parents ec2dbd6 + af242b6 commit e885daa
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dive_sailthru_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _infer_dive_email_type(self, campaign): # noqa: C901 - yeah it's complicat
return DiveEmailTypes.Weekender
elif list_name == "Supply Chain Dive: Operations" and ("Issue" in name or "SCD: Ops v2" in name):
return DiveEmailTypes.Newsletter
elif "Blast" in labels or '-blast-' in name or list_name.lower().endswith("blast list"):
elif "Blast" in labels or '-blast-' in name or "blast=" in name or "blast list" in list_name.lower():
if "QuarterBlast" in name or "Quarters Blast List" in list_name or "Quarter Blast List" in list_name:
return DiveEmailTypes.QuarterBlast
elif "ThirdBlast" in name or "Thirds Blast List" in list_name or "Third Blast List" in list_name:
Expand Down
24 changes: 23 additions & 1 deletion dive_sailthru_client/tests/test_diveSailthruClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,29 @@ def test_infer_dive_email_type_and_brand_real_examples(self):
'expected_publication': 'CFO Dive',
'expected_type': DiveEmailTypes.ThirdBlast,
'comment': 'CFO Dive third blast',
},
},
{
'input': {
'blast_id': 31437039,
'email_count': 54245,
'labels': [],
'list': 'Marketing Dive Quarter Blast List - Group B',
'mode': 'email',
'modify_time': 'Tue, 23 May 2023 09:20:43 -0400',
'modify_user': 'xxx@industrydive.com',
'name': 'client_name=Salesforce.com&pt_id=a12K50000005y8oIAA&blast=quarterblast&site=MarketingDive&send_date=05.23.2023',
'public_url': 'link.divenewsletter.com/public/31437039',
'schedule_time': 'Tue, 23 May 2023 09:27:00 -0400',
'sent_count': 54245,
'start_time': 'Tue, 23 May 2023 09:27:01 -0400',
'status': 'sent',
'subject': 'See how personalized marketing can lift loyalty and raise ROI',
'suppress_list': []
},
'expected_publication': 'Marketing Dive',
'expected_type': DiveEmailTypes.QuarterBlast,
'comment': 'Marketing Dive Quarter Blast with param-type blast name',
},
# You can pull the data for these tests from sailthru_tools scripts/get_campaign.py
]

Expand Down

0 comments on commit e885daa

Please sign in to comment.