"to" argument must be a list or tuple

543 views
Skip to first unread message

Damandeep Singh

unread,
Aug 27, 2018, 11:25:40 AM8/27/18
to Django users
 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='nor...@muncho.app',
        recipient_list=user.email,
        context={
            'full_name':user.first_name
        },
    )
    return token

Matthew Pava

unread,
Aug 27, 2018, 1:32:56 PM8/27/18
to django...@googlegroups.com

Make it a list or tuple by surrounding it in brackets or parentheses.

 

[user.email]

 

or

 

(user.email, )

--
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...@googlegroups.com.
To post to this group, send email to django...@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.

Reply all
Reply to author
Forward
0 new messages