Send emails from sheet
Tags: #googlesheets #gsheet #data #naas_drivers #operations #snippet #email
Description: This notebook allows users to send emails directly from a Google Sheet.
from naas_drivers import gsheet
from naas_drivers import email
username = "USERNAME"
password = "PASSWORD"
email_from = ("***@cashstory.com",)
smtp_server = ("smtp.gmail.com",)
smtp_port = (465,)
smtp_type = ("SSL",)
gmail = emails.connect(
username, password, email_from, smtp_server, smtp_port, smtp_type
)
spreadsheet_id = "1s-TQZrevbmveFKlx2H49fgvr_nZPEY_ffoi0iWal**E"
sheet_name = "********"
df = gsheet.connect(spreadsheet_id).get(sheet_name)
df
emails = df["EMAIL"].drop_duplicates().values
print(emails)
subject = "The tesla action is going up"
content = "check in the link the chart data maide from fresh dataset : [LINK]"
for email in emails:
print(email)
# gmail.send(email_to=email, subject=subject, html=content)
Last modified 1mo ago