-
Notifications
You must be signed in to change notification settings - Fork 8
resend.ApiKey issue - Documentation discrepancy #134
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
Comments
hey @rexwithluv I believe you have the api key set as an env var ? check your it seems that in your example code this code below works fine. import resend
resend.api_key = "re_....."
params: resend.Emails.SendParams = {
"from": "onboarding@resend.dev",
"to": ["delivered@resend.dev"],
"subject": "hi",
"html": "<strong>hello, world!</strong>",
}
email: resend.Email = resend.Emails.send(params) lmk if you still runs into any issues 👍 |
I managed to fix it, but I don't fully understand the exact cause of this. When I call it using Example:# This works correctly
resend.api_key = os.environ(api_key)
# This returns an exception
resend.api_key = os.getenv(api_key) |
hey @rexwithluv if your you only need to set the if you share your full code I can help you find the root cause of why it wasn't working before. |
In the official documentation, resend.api_key is used to set the API key and send emails. However, after testing, I realized that it does not load the API key correctly. Instead, it needs to use resend.ApiKey to properly authenticate and send the email.
The text was updated successfully, but these errors were encountered: