Skip to content

Commit

Permalink
Minghui development (#50)
Browse files Browse the repository at this point in the history
* test pull (#48)

* remove test file

* modify the email module to use the rdas system to send email, move the initiation firebase admin to the star_dev, replaced ses_firebase.py codes by test_ses_firebase.py

* remove test emails and remove '/' from file_paths in the sysvars.py

---------

Co-authored-by: devonleadman <[email protected]>
  • Loading branch information
MingghuiA and devonleadman authored Feb 14, 2024
1 parent 2ffd4dc commit 67e4caa
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 540 deletions.
164 changes: 0 additions & 164 deletions email/ses_firebase.py

This file was deleted.

58 changes: 42 additions & 16 deletions emails/alert.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import boto3
import sys
sys.path.append('/home/aom2/RDAS')
sys.path.append('/home/aom2/RDAS/emails')
from botocore.exceptions import ClientError

sender_email = '[email protected]'
Expand All @@ -10,31 +13,54 @@ def setup_email_client():
)
return client

def send_email(sub,msg,recip,html=None,client=setup_email_client()):
if not client:
return

response = client.send_email(
Source=sender_email,
Destination={
'ToAddresses': [
f'{recip}',
],
},
Message={
def send_email(subject, html, recipient, client=setup_email_client()):
print("Sending emails to:", recipient)
# sender_email = client # Replace with your email
# Set up the email
message={
'Subject': {
'Data': f'{sub}',
'Data': f'{subject}',
},
'Body': {
'Text': {
'Data': f'{msg}',
},

'Html': {
'Data': f'{html}'
},
}
}


# Send the email
response = client.send_email(
Source=sender_email,
Destination={'ToAddresses': [recipient]},
Message=message
)
print("Email sent successfully.")


# def send_email(sub,html,recip,client=setup_email_client()):
# if not client:
# return

# response = client.send_email(
# Source=sender_email,
# Destination={
# 'ToAddresses': [
# f'{recip}',
# ],
# },
# Message={
# 'Subject': {
# 'Data': f'{sub}',
# },
# 'Body': {
# 'Html': {
# 'Data': f'{html}'
# },
# }
# }
# )

def send_raw_email(sub,msg,recip,client=None):
if not client:
Expand Down
50 changes: 0 additions & 50 deletions emails/email_test.py

This file was deleted.

Loading

0 comments on commit 67e4caa

Please sign in to comment.