使用 Spidermon 和 Amazon SES 发送电子邮件

Send Email Using Spidermon and Amazon SES

嗨,我是 spidermon 的新手,我已经阅读了文档,但不明白如何发送包含错误消息正文内容的电子邮件。有人可以提供代码吗? 为了您的参考,我也想添加文档。 https://spidermon.readthedocs.io/

如文档中所述,您必须在 settings.py 文件中配置电子邮件通知:

SPIDERMON_AWS_ACCESS_KEY = INSERT_AWS_ACCESS_KEY
SPIDERMON_AWS_SECRET_KEY = INSERT_AWS_SECRET_KEY
SPIDERMON_EMAIL_SUBJECT = 'My Crawler Report'  # Or another subject
SPIDERMON_EMAIL_SENDER = 'myemail@gmail.com'  # your email that will send it
SPIDERMON_EMAIL_TO = ['...']  # List of emails that will receive the notification

还要确保您的显示器中有 SendSESEmail

例如:

    monitors_finished_actions = [
        SendSESEmail,
    ]

https://spidermon.readthedocs.io/en/latest/actions.html?highlight=email#e-mail-action