Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should I connect to the email-dispatched signal? #214

Open
martincpt opened this issue May 9, 2024 · 1 comment
Open

How should I connect to the email-dispatched signal? #214

martincpt opened this issue May 9, 2024 · 1 comment

Comments

@martincpt
Copy link

I noticed there is an email_dispatched blink signal object available in this package, which sends a signal every time an email is sent.

I'm trying to connect to this signal, but I'm just unable to receive anything whenever an email is sent. What am I missing here?

I have the following in my code:

from fastapi_mail.fastmail import email_dispatched

email_dispatched.connect(lambda msg: print(msg))

I also tried with the standard definition, but nothing gets through either.

Can anyone help with this?

I'd appreciate it!

@DedMaxTech
Copy link

add .connect(..., weak=False) or use def function. Lambda object disposed by GC ond reference loses. You can read more in blink doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants