title: Passing Model objects into function from viewset
body: <p>I have a Django viewset, where I have a function, that sends an email, whenever the viewset, is used.</p>
  
  <p>I override the create function, to send the email, where I have a function, that sends the email to the user. </p>
  
  <p>I want to pass in some arguments, to the function, to display in the email (done with Django's template engine)</p>
  
  <pre><code>class ContactRequestViewSet(viewsets.ModelViewSet):
  queryset = ContactRequest.objects.all()
  permission_classes = [
      permissions.AllowAny
  ]
  serializer_class = ContactRequestSerializer
  
  def create(self, request, *args, **kwargs):
      response = super(ContactRequestViewSet, self).create(request, *args, **kwargs)
      send_email()
      return response
  
  #function to send email
  def send_email():
  htmly = get_template('email.html')
  d = {'company_name': 'dodo'} #i want this dictionary, to contain the attributes from the viewset
  send_mail(
      subject='Test email',
      message='',
      from_email='test@email.com',
      recipient_list=['test@email.com'],
      html_message= htmly.render(d)
  )
  </code></pre>
  
  <p>right now I just have a sample placeholder as <code>d</code> but here I want to pass in attributes from the serializers/model, that the user provided, I tried passing in the serializer, and accessing its attributes, but I don't know how to do this the proper way</p>