The code is generating the .csv, but I am lost when sending an email. Any help would be excellent.
# Function to send an email with attachment
UserList = []
users = gis.users.search(max_users=10000)
#print(users)
emails_of_user = [member.email for member in users]
#print(emails_of_user)
# Find the user with the specified email address
unique_user = next((member for member in users if member.email == 'christopher.mask@ag.ok.gov'), None)
# Check if the user with the specified email is found
if unique_user:
print("Unique user found:")
print("Username:", unique_user.username)
print("Email:", unique_user.email)
group.notify(users=unique_user, subject= "Test Message", message="Testing the notification system",method="email")
else:
print("User with email not found.")
print results are:
CSV file exported successfully to: HistoricalFireOccurrence_VFD_LastMonth.csv
Unique user found:
Username: CMask_OKForestry
Email: christopher.mask@ag.ok.gov
Not even sure this can be done with notebook.
Best,
Christopher Mask