def post(self, request, *args, **kwargs): context = self.get_context_data() form = SendSuggestionForm(self.request.POST or None) if form and form.is_valid(): recipients = RECIPIENTS_SUGGESTION subject = SUBJECT_SUGGESTION message = request.POST.get('text', '') send_simple_email(recipients, subject, message) return super(IndexView, self).render_to_response(context)
def send_email_action_task(recipients, subject, message): send_simple_email(recipients, subject, message)