Make it a list or tuple by surrounding it in brackets or parentheses.
[user.email]
or
(user.email, )
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Damandeep Singh
Sent: Monday, August 27, 2018 6:08 AM
To: Django users
Subject: "to" argument must be a list or tuple
from templated_email import send_templated_mail
from django.contrib.auth.tokens import default_token_generator
def send_activation_mail(user):
token = default_token_generator.make_token(user)
print('token ---->', token)
send_templated_mail(
template_name='welcome',
from_email='noreply@muncho.app',
recipient_list=user.email,
context={
'full_name':user.first_name
},
)
return token
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4a66a8f3-c97a-46bc-af1c-c7b44ffe8dd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment