-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
2ffd4dc
commit 67e4caa
Showing
7 changed files
with
139 additions
and
540 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]' | ||
|
@@ -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: | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.