sending email withdjango code example
Example: sending email with django
from django.core.mail import send_mail
class UserList(generics.ListCreateAPIView):
queryset = User.objects.all()
serializer_class = UserSerializer
def perform_create(self, serializer):
created_object = serializer.save()
send_mail('Subject here','Here is the message.','[email protected]',
[created_object.email], fail_silently=False,)