1👍
✅
You can assign request.POST.get(FORM_VARIABLE) to your local variables to capture POST data from users. In return you can craft reply by inserting your reply attributes into EmailMessage(). Here’s how your code could look like:
nom = request.POST.get('first_name') + " " + request.POST.get('last_name')
sujet = request.POST.get('subject')
a_qui = request.POST.get('email')
de_qui = YOUR_REPLY_EMAIL
message = get_template('formulaire_eleves/courriel.html').render(Context({'form': form, 'nom': nom}))
msg = EmailMessage('REPLY_SUBJECT', message, a_qui, de_qui)
msg.send()
Source:stackexchange.com