Django - Send email with URL to newly uploaded file
I have a Django app where users can upload PDF files. The PDF files will be saved on my cloud provider. After successfully submitting the PDF, I want to send an email to the user with the URL to the PDF on my cloud. I've been trying to do it by overriding
form_valid() but at that point, the URL is not yet generated. The URL also isn't hardcoded, so I can't just point to a hard coded URL in
Any ideas on how to solve this?
Can you please provide us the code within
form_valid() ? You need to insert your logic after super.form_valid() e.g.:
def form_valid(self, form): ret = super().form_valid(form) instance = form.instance # get the filename and send an email ... return ret