Skip to content

Commit 8588369

Browse files
committed
Merge branch 'master' of github.com:Shuffle/python-apps
2 parents 4d9f033 + 67b16d4 commit 8588369

File tree

12 files changed

+19
-192
lines changed

12 files changed

+19
-192
lines changed

email/1.3.0/api.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ actions:
2424
- name: recipients
2525
description: The recipients of the email
2626
multiline: false
27-
example: "[email protected],frikky@shuffler.io"
27+
example: "[email protected],support@shuffler.io"
2828
required: true
2929
schema:
3030
type: string
@@ -51,7 +51,7 @@ actions:
5151
- name: username
5252
description: The SMTP login username
5353
multiline: false
54-
example: "frikky@shuffler.io"
54+
example: "support@shuffler.io"
5555
required: false
5656
schema:
5757
type: string
@@ -79,14 +79,14 @@ actions:
7979
- name: recipient
8080
description: The receiver(s) of the email
8181
multiline: false
82-
example: "frikky@shuffler.io,frikky@shuffler.io"
82+
example: "support@shuffler.io,test@shuffler.io"
8383
required: true
8484
schema:
8585
type: string
8686
- name: cc_emails
8787
description: cc_emails
8888
multiline: false
89-
example: "frikky@shuffler.io,frikky@shuffler.io"
89+
example: "support@shuffler.io,test@shuffler.io"
9090
required: false
9191
schema:
9292
type: string
@@ -138,7 +138,7 @@ actions:
138138
- name: username
139139
description: The SMTP login username
140140
multiline: false
141-
example: "frikky@shuffler.io"
141+
example: "support@shuffler.io"
142142
required: true
143143
schema:
144144
type: string

email/1.3.0/src/app.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ def send_email_shuffle(self, apikey, recipients, subject, body):
7474
headers = {"Authorization": "Bearer %s" % apikey}
7575
return requests.post(url, headers=headers, json=data).text
7676

77-
def send_email_smtp(
78-
self, smtp_host, recipient, subject, body, smtp_port, attachments="", username="", password="", ssl_verify="True", body_type="html", cc_emails=""
79-
):
77+
def send_email_smtp(self, smtp_host, recipient, subject, body, smtp_port, attachments="", username="", password="", ssl_verify="True", body_type="html", cc_emails=""):
78+
self.logger.info("Sending email to %s with subject %s" % (recipient, subject))
8079
if type(smtp_port) == str:
8180
try:
8281
smtp_port = int(smtp_port)
8382
except ValueError:
8483
return "SMTP port needs to be a number (Current: %s)" % smtp_port
8584

85+
self.logger.info("Pre SMTP setup")
8686
try:
8787
s = smtplib.SMTP(host=smtp_host, port=smtp_port)
8888
except socket.gaierror as e:
@@ -95,6 +95,7 @@ def send_email_smtp(
9595
else:
9696
s.starttls()
9797

98+
self.logger.info("Pre SMTP auth")
9899
if len(username) > 1 or len(password) > 1:
99100
try:
100101
s.login(username, password)
@@ -108,6 +109,7 @@ def send_email_smtp(
108109
body_type = "html"
109110

110111
# setup the parameters of the message
112+
self.logger.info("Pre mime multipart")
111113
msg = MIMEMultipart()
112114
msg["From"] = username
113115
msg["To"] = recipient
@@ -116,10 +118,12 @@ def send_email_smtp(
116118
if cc_emails != None and len(cc_emails) > 0:
117119
msg["Cc"] = cc_emails
118120

121+
self.logger.info("Pre mime check")
119122
msg.attach(MIMEText(body, body_type))
120123

121124
# Read the attachments
122125
attachment_count = 0
126+
self.logger.info("Pre attachments")
123127
try:
124128
if attachments != None and len(attachments) > 0:
125129
print("Got attachments: %s" % attachments)
@@ -153,7 +157,7 @@ def send_email_smtp(
153157
except Exception as e:
154158
self.logger.info(f"Error in attachment parsing for email: {e}")
155159

156-
160+
self.logger.info("Pre send msg")
157161
try:
158162
s.send_message(msg)
159163
except smtplib.SMTPDataError as e:

oauth2-example/1.0.0/Dockerfile

Lines changed: 0 additions & 26 deletions
This file was deleted.

oauth2-example/1.0.0/api.yaml

Lines changed: 0 additions & 53 deletions
This file was deleted.

oauth2-example/1.0.0/docker-compose.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

oauth2-example/1.0.0/env.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

oauth2-example/1.0.0/requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

oauth2-example/1.0.0/run

Lines changed: 0 additions & 17 deletions
This file was deleted.

oauth2-example/1.0.0/src/app.py

Lines changed: 0 additions & 61 deletions
This file was deleted.

shuffle-subflow/1.0.0/src/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ def run_userinput(self, user_apikey, sms="", email="", subflow="", information="
7777
argument = json.dumps({
7878
"information": information,
7979
"parent_workflow": self.full_execution["workflow"]["id"],
80-
"frontend_continue": "%s/workflows/%s/run?authorization=%s&reference_execution=%s&answer=true" % (frontend_url, self.full_execution["workflow"]["id"], self.full_execution["authorization"], self.full_execution["execution_id"]),
81-
"frontend_abort": "%s/workflows/%s/run?authorization=%s&reference_execution=%s&answer=false" % (frontend_url, self.full_execution["workflow"]["id"], self.full_execution["authorization"], self.full_execution["execution_id"]),
80+
"frontend_continue": "%s/forms/%s?authorization=%s&reference_execution=%s&answer=true" % (frontend_url, self.full_execution["workflow"]["id"], self.full_execution["authorization"], self.full_execution["execution_id"]),
81+
"frontend_abort": "%s/forms/%s?authorization=%s&reference_execution=%s&answer=false" % (frontend_url, self.full_execution["workflow"]["id"], self.full_execution["authorization"], self.full_execution["execution_id"]),
8282
"api_continue": "%s/api/v1/workflows/%s/execute?authorization=%s&reference_execution=%s&answer=true" % (frontend_url, self.full_execution["workflow"]["id"], self.full_execution["authorization"], self.full_execution["execution_id"]),
8383
"api_abort": "%s/api/v1/workflows/%s/execute?authorization=%s&reference_execution=%s&answer=false" % (frontend_url, self.full_execution["workflow"]["id"], self.full_execution["authorization"], self.full_execution["execution_id"]),
8484
})

0 commit comments

Comments
 (0)