apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
61.43k stars 13.39k forks source link

celeryconfig.py #29556

Open hswlxc opened 1 month ago

hswlxc commented 1 month ago

Bug description

superset_config.py.zip This is my profile, and according to this configuration, the email cannot be sent

How to reproduce the bug

image image

Screenshots/recordings

No response

Superset version

4.0.1

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

dosubot[bot] commented 1 month ago

To resolve the issue where emails cannot be sent according to your configuration in superset_config.py while using Superset version 4.0.1 with Python 3.9 and Node 16, ensure that the email configuration settings in your superset_config.py are correctly set. Here is an example configuration:

# smtp server configuration
EMAIL_NOTIFICATIONS = True  # Enable email notifications
SMTP_HOST = "your_smtp_host"
SMTP_STARTTLS = True
SMTP_SSL = False
SMTP_USER = "your_smtp_user"
SMTP_PORT = 587  # or the port your SMTP server uses
SMTP_PASSWORD = "your_smtp_password"
SMTP_MAIL_FROM = "your_email@example.com"
SMTP_SSL_SERVER_AUTH = False
ENABLE_CHUNK_ENCODING = False

# Optional: Customize email headers
def email_header_mutator(msg, **kwargs):
    # Example: Add a custom header
    msg["X-Custom-Header"] = "CustomValue"
    return msg

EMAIL_HEADER_MUTATOR = email_header_mutator

Make sure to replace the placeholder values (your_smtp_host, your_smtp_user, your_smtp_password, and your_email@example.com) with your actual SMTP server details.

Additionally, ensure that EMAIL_NOTIFICATIONS is set to True to enable email sending.

The EMAIL_HEADER_MUTATOR function allows you to customize email headers if needed. This function is called within the send_email_smtp function to mutate the email message before sending it.

If you continue to experience issues, you can refer to the superset/reports/notifications/email.py file for more details on how email notifications are handled in Superset. This file includes the EmailNotification class, which is responsible for sending email notifications for report recipients. It uses the send_email_smtp function to send emails, and you can check the logs for any errors that might be raised during the email sending process [1][2].

To continue talking to Dosu, mention @dosu.

rusackas commented 1 month ago

It might help if you can provide a more complete Issue title, and provide any errors (server side or client side) that you see. Most of us can't read the screenshots, so if you can help us understand what those illustrate, that'd be helpful. Lastly, it might help to throw your config file at the bots in the #ask-ai channel on slack to see if it can spot any errors or omissions.