Contact form for the FR website
In the old site we had a contact form for our user who don't know how to subscribe to the lists or Nabble. The content of the form was sent to the users@fr list.
With the new Silverstripe instance, it seems impossible to do the same. Could you help us to achieve this form? What we need to retrieve is:
- the mail address that send the form and the answer address
- a text field to retrieve the subject of the request
Let me know if you need further information
Thanks in advance for your help - Sophie
#1 Updated by Christian Lohmaier over 5 years ago
- Assignee set to Christian Lohmaier
Setting a reply-to address is possible, however you need to save the email-configuration first before the fields are added to the dropdown so you can pick them.
Indeed in the current version there's no such option for the summary of the mail. Will need to patch the module.
#2 Updated by Jean Spiteri over 5 years ago
- Assignee deleted (
I'm currently working on it. The updated code should be sent to the UserForms developers for review as a pull request today or tomorrow.
#3 Updated by Jean Spiteri over 5 years ago
- % Done changed from 0 to 80
I have managed to finish before and therefore I have submitted the pull request to the maintainers of the UserForms module today. I should receive some feedback during the next few days.
#5 Updated by Christian Lohmaier over 5 years ago
the pull request still contains some functional errors - I'll attach a fix for the remaining problems.
Please apply and "git commit --amend" your commit/the pullrequest.actual bugs:
- the settings are all stored as strings, so one needs to cast to int in the filterByCallback function, otherwise it will never match
- the last argument of the insertAfter function specifies after what field the new one should be added. You added an invalid name 'SendEmailSubjectField' instead of 'EmailSubjectField'
other changes are tab vs spaces, and also converting the existing lines to use the new-style getters (i.e. ClassName::get()->filter(...) instead of DataObject::get(....)
the first two hunks are to avoid reordering/changes
Other change is removal of the unnecessary if-checks (as master for the module requires silverstripe 3.1 or later and that just returns empty DataLists/ArrayLists and not NULL as previous versions of silverstripe did, so no need to guard against that.
Applied pull-request + the patch to the live site.
#7 Updated by Jean-Baptiste Faure over 5 years ago
Thank you very much ! Now I can select a text field as subject of the mail, so the main issue is solved. :-)
However I still have 2 problems:
1/ In the preceding version of Silverstripe, it was possible to use the email provided by the user as "Send email from". In the new version it is not possible.
As a consequence, I need to use a fictive email (for example "firstname.lastname@example.org") to avoid the cryptic email from the server.
The second and more annoying consequence is that it is not possible anymore to answer to the user even if the reply_to: field is filed. Indeed, while it works if the mail is sent to a personal email like mine, it does not work if the mail is sent to our users mailing-list because the LibreOffice mailing-lists ignore the reply to: field. So it could be better if it was possible to choose the sender email as we can choose the reply_to: email
2/ mail formatting: because our mailing-lists do no accept html, I need to send the mail in simple text. The resulting mail looks like that:
Email: - email@example.com
Sujet: - Sixième test du nouveau formulaire de demande d'aide
Question: - Bonjour
Un de plus et ce n'est sans doute pas fini
"Email:", "Sujet:" and "Question:" are the names of the form fields. There is 2 issues in the mail:
a) there is a blank character in front of Email: but not in front of the others field names;
b) there is a - after each field name and the field contents start just after; the resulting mail would look better if the field contents was written on the next line as it is done when the mail is sent in html.
My form is here: http://fr.libreoffice.org/get-help/poser-une-question
Best regards. JBF
#8 Updated by Christian Lohmaier over 5 years ago
if the mailing list ignroes reply-to, then I'd consider it a bug in your mail-client - reply to all should respect those headers
Claiming to be someone else is tricky business, so better to avoid that (sending mail with from specified by the user - it is a mail that originates from our servers and we don't want paypal-scams sent via our servers for example...
did you try already what happens when you let the mailinglist do the html-stripping?
#9 Updated by Jean-Baptiste Faure over 5 years ago
It seems that Thunderbird is more smart than me: in fact it does not ignore the reply-to fields if the email in the reply-to is not the one who is answering. I copied the mails I have sent to our users ML (http://go.mail-archive.com/syuGRWByjjB6-VwCIm6222vsCdE=) in another mailbox where my personal and LibreOffice emails are unknown and when I choose reply to all, both the users FR ML and my email are copied in the To: field of the answer. So it works as expected.
Concerning the email formatting, my first try was to let the mailinglist do the html-stripping and that gives the result in the above mail where all paragraphs are joined.
Best regards. JBF
#10 Updated by Jean Spiteri over 5 years ago
Jean-Baptiste Faure, did you try the Send Pain Email checkbox in the Silverstripe form where you set the mailing things (where you set subject, etc.). Also can you screenshot the email after that because I can't really understand the problem. Sorry for the inconvenience and glad the major problem is fixed.
#11 Updated by Jean-Baptiste Faure over 5 years ago
Jean Spiteri wrote:
Jean-Baptiste Faure, did you try the Send Pain Email checkbox in the Silverstripe form where you set the mailing things (where you set subject, etc.).
Yes I did when I saw the result of the html mail filtered by the ML.
Attached is the screenshot of the plain text mail. I had the same problem in the previous version of Silverstripe and the only solution I found was to add "\n" string at the end of field names to force the newline. The result was not satisfactory for the user seeing these weird characters in the form.
Best regards. JBF
#12 Updated by Jean Spiteri over 5 years ago
Talked with someone more experienced with Silverstripe and pointed out a possible bug in the code which causes the extra space. I have asked Christian to try to do a simple edit on our servers to check if this is the problem. Hope to have a reply by next week.
#13 Updated by Jean Spiteri over 5 years ago
OK, the module was patched on our server so the extra space is now removed. If you have any more problem with his, feel free to ask. If not, we can close this issue.
#14 Updated by Jean Spiteri over 5 years ago
- Status changed from New to Closed
- % Done changed from 80 to 100