from django.core.mail import send_mail
from celery.task import task
@task
def send_welcome_email(email_address):
send_mail('Welcome to your site', 'message.', '[email protected]',
[email_address], fail_silently=False)
from django.views.generic.base import View
from yourapp.tasks.misc import send_welcome_email
class UserRegistrationView(View):
def post(self, request):
# registration code
send_welcome_email.delay(email_address=email)