sabuhish / fastapi-mail

Fastapi mail system sending mails(individual, bulk) attachments(individual, bulk)
https://sabuhish.github.io/fastapi-mail/
MIT License
680 stars 82 forks source link

'list' object has no attribute 'dict' #153

Closed marc-odp closed 1 year ago

marc-odp commented 1 year ago

I am struggling to make my code work. I get this error :

recipients=email.dict().get("email"),
AttributeError: 'list' object has no attribute 'dict'

Declaration :

class EmailSchema(BaseModel):
    email: List[EmailStr]

Any idea ?

marc-odp commented 1 year ago

I found the mistake. I was not declaring the variable correctly. Now it is ok I think. email = EmailSchema(email=['info@website.com'])