Skip to content

Commit

Permalink
PAPP-34391: small styling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tapishj-splunk committed Aug 1, 2024
1 parent 06084ff commit 5b4c74d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions gsgmail_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,10 +1056,11 @@ def _process_email_ids(self, action_result, config, service, email_ids, data_typ

if config.get("forwarding_address"):
ret_val, sent_message = self._forward_email(message, vault_ids, config, action_result)
to = config["forwarding_address"]
if phantom.is_fail(ret_val):
self.send_progress("Forwarded email with id {0} to {1} failed".format(emid, config["forwarding_address"]))
self.send_progress("Forwarded email with id {0} to {1} failed".format(emid, to))
else:
self.send_progress("Forwarded email with id {0} to {1}. Id of forwarded message: {2}".format(emid, config["forwarding_address"], sent_message["id"]))
self.send_progress("Forwarded email with id {0} to {1}. Forwarded message id: {2}".format(emid, to, sent_message["id"]))

def _auto_reply(self, message, config, action_result):
raw_encoded = base64.urlsafe_b64decode(message["raw"].encode('UTF8'))
Expand Down Expand Up @@ -1101,7 +1102,15 @@ def _forward_email(self, email_details, attachment_vault_ids, config, action_res

subject = "Fwd: " + email_details["email_headers"][0]["subject"]
body = email_details['parsed_plain_body'] or email_details.get("parsed_html_body", None)
forwrded_message = self._create_message(config["login_email"], config["forwarding_address"], None, None, subject, body, vault_ids=attachment_vault_ids)
forwrded_message = self._create_message(
config["login_email"],
config["forwarding_address"],
None,
None,
subject,
body,
vault_ids=attachment_vault_ids
)

media = MediaIoBaseUpload(BytesIO(forwrded_message.as_bytes()), mimetype='message/rfc822', resumable=True)

Expand Down

0 comments on commit 5b4c74d

Please sign in to comment.