diff --git a/shuffle-tools/1.2.0/src/app.py b/shuffle-tools/1.2.0/src/app.py index c715810a..9423a3a4 100644 --- a/shuffle-tools/1.2.0/src/app.py +++ b/shuffle-tools/1.2.0/src/app.py @@ -191,7 +191,9 @@ def send_sms_shuffle(self, apikey, phone_numbers, body): data = {"numbers": targets, "body": body} - url = "https://shuffler.io/api/v1/functions/sendsms" + # this is just to expose this feature to onprem users as well + base = self.url if "shuffler.io" in self.url or "run.app" in self.url else "https://shuffler.io" + url = "%s/api/v1/functions/sendsms" % base headers = {"Authorization": "Bearer %s" % apikey} return requests.post(url, headers=headers, json=data, verify=False).text @@ -226,7 +228,9 @@ def send_email_shuffle(self, apikey, recipients, subject, body, attachments=""): except Exception as e: pass - url = "https://shuffler.io/functions/sendmail" + # this is just to expose this feature to onprem users as well + base = self.url if "shuffler.io" in self.url or "run.app" in self.url else "https://shuffler.io" + url = "%s/functions/sendmail" % base headers = {"Authorization": "Bearer %s" % apikey} return requests.post(url, headers=headers, json=data).text