Closed nop33 closed 9 years ago
Have you checked if Django can send emails? Often this fails silently because of incorrect SMTP settings or something like that.
I can send emails when using the cmsplugin_contact without a problem. But not with my custom app which extends it...
I am not getting any errors in the logs. Just a page refresh with the entered data pre-filled in the contact form and no email sent. Is there any other example of a cmsplugin_contact extension that I could see?
Recently we merged a pull request that changed the behavior of the plugin after form submit. Probably the problem was introduced there. I will check tomorrow if I can find something.
So you managed to reproduce it? Thanks for the effort.
Ok I just uploaded a new release to PIPy. Please have a look at the updated example.
I deployed the new version but the problem is not solved. I have the same problem: Page refresh after the form submit and no email. Here are my files: https://gist.github.com/nop33/81df80c3e95703c13a01 It looks like it only happens when I select my custom template. It works fine when selecting the default template.. Thanks
However, if I just copy the contents of the default template (https://github.com/maccesch/cmsplugin-contact/blob/master/cmsplugin_contact/templates/cmsplugin_contact/contact.html) into my template file, I still get the problem. So there is nothing wrong with my custom template.
Can you please reopen this ticket?
It seems like you're overwriting the subject field of the basic contact form and also introduce your own message field instead of using the content field provided. Why do you do that?
I just wanted to add the labels of email, subject and content in the admin form, so I can create instances of the plugin in different languages. I will try to rename the fields and try to see if it works.
Turns out the problem was that in the forms.py I had the line
mandatory_note = forms.CharField()
My purpose was to let the user define a message for the mandatory fields. By adding this line in the forms.py I guess that the form was not submitting since there was no value for this field and it was required.
Sorry for the trouble, I am still learning Django.
No worries. I'm glad you found the problem :)
I created an app as described in the
examples/cmsplugin_custom_contact
, to subclass cmsplugin_contact and add custom fields. I am also trying to use my own template. Everything looks fine expect from the fact that when submitting the form, the page refreshes and there is no email sent.My files for the cmsplugin_custom_contact app look like this: https://gist.github.com/nop33/27b6be6d2e1819d7441a
Any idea what the problem is? Thanks