Skip to content

Commit d34b054

Browse files
committed
feat: fallback to shuffler.io if url is not regional
1 parent 81c9c79 commit d34b054

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎shuffle-tools/1.2.0/src/app.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ def send_sms_shuffle(self, apikey, phone_numbers, body):
191191

192192
data = {"numbers": targets, "body": body}
193193

194-
url = "%s/api/v1/functions/sendsms" % self.url
194+
base = self.url if "shuffler.io" in self.url or "run.app" in self.url else "https://shuffler.io"
195+
url = "%s/api/v1/functions/sendsms" % base
195196
headers = {"Authorization": "Bearer %s" % apikey}
196197
return requests.post(url, headers=headers, json=data, verify=False).text
197198

@@ -226,7 +227,8 @@ def send_email_shuffle(self, apikey, recipients, subject, body, attachments=""):
226227
except Exception as e:
227228
pass
228229

229-
url = "%s/functions/sendmail" % self.url
230+
base = self.url if "shuffler.io" in self.url or "run.app" in self.url else "https://shuffler.io"
231+
url = "%s/functions/sendmail" % base
230232
headers = {"Authorization": "Bearer %s" % apikey}
231233
return requests.post(url, headers=headers, json=data).text
232234

0 commit comments

Comments
 (0)