Skip to content

Commit 37f7ec8

Browse files
committed
feat: use regional url for send_sms and send_email with onprem fallback
1 parent 2ad4bc4 commit 37f7ec8

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-
base = self.url if "shuffler.io" in self.url else "https://shuffler.io"
194+
# this is just to expose this feature to onprem users as well
195+
base = self.url if "shuffler.io" in self.url or "run.app" in self.url else "https://shuffler.io"
195196
url = "%s/api/v1/functions/sendsms" % base
196197
headers = {"Authorization": "Bearer %s" % apikey}
197198
return requests.post(url, headers=headers, json=data, verify=False).text
@@ -227,7 +228,8 @@ def send_email_shuffle(self, apikey, recipients, subject, body, attachments=""):
227228
except Exception as e:
228229
pass
229230

230-
base = self.url if "shuffler.io" in self.url else "https://shuffler.io"
231+
# this is just to expose this feature to onprem users as well
232+
base = self.url if "shuffler.io" in self.url or "run.app" in self.url else "https://shuffler.io"
231233
url = "%s/functions/sendmail" % base
232234
headers = {"Authorization": "Bearer %s" % apikey}
233235
return requests.post(url, headers=headers, json=data).text

0 commit comments

Comments
 (0)