adding more debuging
This commit is contained in:
parent
2de4d54360
commit
3aca69e84e
@ -1,7 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
title: Send Email
|
title: Send Email
|
||||||
author: Josh Knapp
|
author: Josh Knapp
|
||||||
version: 0.2.0
|
version: 0.4.0
|
||||||
description="Send email via SMTP to user specificed address"
|
description="Send email via SMTP to user specificed address"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -9,7 +9,7 @@ import subprocess, sys
|
|||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
|
|
||||||
# Try to import boto3, install if not present
|
# Try to import required packages, install if not present
|
||||||
try:
|
try:
|
||||||
import smtplib
|
import smtplib
|
||||||
from email.mime.text import MIMEText
|
from email.mime.text import MIMEText
|
||||||
@ -58,6 +58,7 @@ class Tools:
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.valves = self.Valves()
|
self.valves = self.Valves()
|
||||||
|
print(f"Debug Status {self.valves.DEBUG}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def send_email(self, to_address: str, subject: str, message: str) -> dict:
|
def send_email(self, to_address: str, subject: str, message: str) -> dict:
|
||||||
@ -72,6 +73,8 @@ class Tools:
|
|||||||
Returns:
|
Returns:
|
||||||
dict: Response containing success status and message
|
dict: Response containing success status and message
|
||||||
"""
|
"""
|
||||||
|
if self.valves.DEBUG:
|
||||||
|
print("Debug activated, sending email...")
|
||||||
try:
|
try:
|
||||||
# Create message container
|
# Create message container
|
||||||
msg = MIMEMultipart()
|
msg = MIMEMultipart()
|
||||||
|
Loading…
Reference in New Issue
Block a user