-
Posts
1,424 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Juergen
-
I have found the cause for this strange behavior: This is specific to my hoster world4you.com, but the problem could occur on other hosters too. My hoster does not allow you to send mails from domains other than the website domain itself. For example: My domain is www.mysite.eu, then I can only send mails where the email address ends with the domain name (e.g. myemail@mysite.eu). When I try to send an email from a different email domain (e.g. gmail.com), the email is not sent. I have not found the solution to disable this behavior, so I must contact my Provider. I guess this could be a security feature of the provider.
-
No, but I think there must be another cause than I have thought first. The strange thing is that I can send mails by using 2 of my modules with the WireMail class without problems on that host. Only the third module makes problems. I have solved this problem for now by using the WireMailSmtp module.
-
Hello at all I encountered a strange issue when sending emails using the Wiremail class from a shared host (world4you.com). Short description of the problem I added the following code from the documentation for the WireMail class to one of my templates for testing purposes: $m = $mail->new(); $m->to('myemailadress@example.at') // will be replaced with my real mail addy ->from('testmail@test.at') ->subject('Message Subject') ->body('Optional message body in plain text') ->bodyHTML('<html><body><p>Optional message body in HTML</p></body></html>') ->send(); After loading a page with this template, the email should be sent to my email address, but I never receive an email. If I use the same code on my local Installation with XAMPP using Gmail as my mail Client everything works as expected. So I tried to figure out where the problem might be, and I discovered the following: The WireMail class contains the send() method, which is responsible for sending the email. There you will find the PHP mail function, which contains a header variable ($header). If I remove this header variable from the brackets, the email is sent; otherwise, it is not. But the email content will not be displayed properly without this header variable. Before removing the header variable: if(@mail($to, $subject, $body, $header)) $numSent++; After: if(@mail($to, $subject, $body)) $numSent++; The problem could therefore be due to an incorrect header. So I took a look at the function renderMailHeader() which is responsible for creating the mail header syntax. I found out that the email is only sent if the value of “From” in the header is enclosed in double quotation marks, otherwise it will not be sent (see figure below). This does not seem to be important on my local installation. By default, the "From" value (in this case "myemail@example.com) is not between quotes in the header. If I change this inside the renderMailHeader() function, the mail will be sent. Only to mention: There is no entry in the log files indicating that something went wrong. Does anyone else have the same problem on a shared host and know how to fix it? I don't want to use SMTP instead, though. I guess there must be a better solution than changing something in the code or the problem is not the header syntax. Perhaps the header is not the problem, but rather the problem is related to something else?!? Thanks in advance for your help and hints
-
Hello @gloser Glad to hear that you use FrontendForms!! If you create the form by yourself as a standalone it will not work, because the $form->render() method is connected to the isValid() method. This is the place where all the magic happens. To create the desired ouptut you will need to manipulate the form markup by using some manipulations-methods. Each element of a form is an object and can be manipulated in different ways. As I can see you are using Bootstrap as your prefered CSS framework. I will try to help you to get the desired output. For this reason it would be great if you post the code of the form here in the forum or alternatively you can send me the the code via PM. Then I have a starting point where I can add the necessary manipulations. Best regards Jürgen
-
This module is a remake of Ryan's classic Comments module, but uses its own code and is based on the FrontendForms module. This is the third module in the "Frontend" series, alongside the FrontendContact and FrontendLoginRegister modules. To use this module, FrontendForms must be installed. Otherwise, it won't work! If you don't have this module installed yet, please download and install it first! This module has a large amount of configuration settings supports pagination supports UiKit3, Boostrap 5 and Pico 2 CSS frameworks out of the box and a lot more The download link as well as many more images and the documentation for this module can be found on Github. Please note: This is the first version in an early alpha stage, so using it on live sites is not recommended. This module should be available in the module directory eventually, but it still needs a lot of testing. If you discover any issues or have ideas for improving the module, please post them here in the forum or directly on Github. Happy testing!
- 3 replies
-
- 10
-
-
Hello @dynweb Thanks for pointing out this issue. To be honest, I have never thought of such a possibility, because I always wanted to output a feedback message after the form submission. Your contribution leads me to update the setSuccessMsg() and setErrorMsg() methods to accept boolean values too. So if you want to disable the output of one of them please add false inside the parenthesis. These prevents the output of a message after form submission. $form->setSuccessMsg(false); This is more elegant than adding an empty string, but you need to replace the following file from Github with yours: https://github.com/juergenweb/FrontendForms/blob/main/Formelements/Form.php This addition will be automatically included in the next update, but I do not want to update the module today. You will find more infos about the new additions inside the changelog.md. Best regards Jürgen
-
Hello @Claus Thanks for confirming that the problem is solved now. Regarding to your new problem: This error message comes from the validator of the Valitron library which I use to validate form fields. This is an external library and not written by myself. This validator checks if the given email domain (fe gmail.com) exists. If not it throws an error, but it does not check if the full email address exists (fe myemail@gmail.com). I have tested it with one of my Gmail addresses locally and there was no problem, but this email address ends with "gmail.com". Do you use another Gmail domain than "gmail.com"? You can also send me the Gmail address which causes the error via PW because it is not recommended to post it here and I will test it on my site.
-
If a user is logged in, than the email address will be pre-filled with the value from the user page of this user. This is the default behavior. If user is a guest, than the user has to fill out the email address manually. But it is not possible, that the email address from the configuration will be displayed in the email field. Please check this once more. If the problem persists after the update, you can send me screenshots of the issue via PM if you want.
-
Hello @PWaddict I have added selectively loading of the JS and CSS files in the backend. To test it, you only need to replace the file https://github.com/juergenweb/FrontendForms/blob/main/FrontendForms.module once more. It contains now additional methods to check if the files should be loaded on the current page or not. It was not so easy, because the image picker files of FrontendForms will also be used by other modules from the FrontendForms family and I have to take care of it. Best regards
-
Hello @PWaddict I have added a possible fix to Github. Please replace the following file: https://github.com/juergenweb/FrontendForms/blob/main/FrontendForms.module I do not have LoginRegisterPro, so I cannot reproduce your issue, but the new fix contains a check, if page is an admin page or not. So the files should only be loaded on admin pages now. Please test it and let me know if it works for you now. Best regards
-
Hello @PWaddict You're talking about backend files, not frontend files. You can only remove frontend files within the module configuration (or via the API call). In the frontend, only pages that contain at least 1 form of FrontendForms contain the JS and CSS files. I tested it on my local installation. On all other pages the files will not be inserted. But you're right, the backend JS and CSS files are added on every admin page and not just on the configuration page of the FrontendForms module. I'll fix that. I hope that's what you mean. Otherwise, please correct me if I have misunderstood you. Best regards Jürgen
-
Hello @PWaddict It is/should be stable. This module is online for a long time, and there were no problems reported in the past - so it should work without problems. I have deleted the misleading text in the module description. I have not done it in this way before, but it should work without activation links. The only thing you have to take care is that you have to to save the activation datetime during you have created the new user. As you can see in the code below, the user field for the activation time is called "fl_activationdatetime". $user->fl_activationdatetime = time(); This should work, but test it by yourself. Best regards
-
Hello @BigRed Ensure your website includes links to the login and/or registration page. These links aren't created by default, but some templates (like the UIKIT3 template) support this in their navigation functionality. Therefore, if you don't have links on your website (e.g., within a navigation) pointing to the page(s) that use the login and/or registration template, please create them by yourself. Then you can log in/register as usual. Best regards
-
No, this could not be a reason, because you are also using these lines of code to manipulate the classes: $checkbox->getFieldWrapper()->setAttributes(['data-uk-grid', 'class' => 'uk-grid-small']); $checkbox->getLabel()->wrap()->setAttribute('class', 'uk-width-expand'); This methods are working in the same way as the getErrorMessage() method. I cannot tell you, why getFieldWrapper() and getLabel() works, but getErrorMessage() not. As written before, in my case everything works as expected. If you cannot find the cause, please use the hook method to get your desired result.
-
Here is my ouput from the source code: <div class="uk-margin uk-grid-small error uk-grid" data-uk-grid="data-uk-grid" id="test-checkbox-fieldwrapper"> <div class="uk-width-auto uk-first-column"> <input id="test-checkbox" name="test-checkbox" type="checkbox" class="uk-checkbox uk-form-danger" required="" aria-invalid="true" aria- errormessage="test-checkbox-errormsg"> </div> <div class="uk-width-expand"> <label class="uk-form-label required" for="test-checkbox">My Checkbox Label<span class="asterisk">*</span></label> </div> <p class="uk-text-danger uk-width-1-1 uk-grid-margin uk-first-column" id="test-checkbox-errormsg">My custom required text</p> </div> As you can see the class "uk-width-1-1" is set on the error text.
-
Are you sure? I have tested it on my site and it works as expected: $checkbox = new \FrontendForms\InputCheckbox('checkbox'); $checkbox->setLabel('My Checkbox Label'); $checkbox->setRule('required')->setCustomMessage('My custom required text'); $checkbox->getFieldWrapper()->setAttributes(['data-uk-grid', 'class' => 'uk-grid-small']); $checkbox->prepend('<div class="uk-width-auto">'); $checkbox->append('</div>'); $checkbox->getLabel()->wrap()->setAttribute('class', 'uk-width-expand'); $checkbox->getErrorMessage()->setAttribute('class', 'uk-width-1-1'); $form->add($checkbox); Do you have removed the hook?
-
Take a look at the form field class file (https://github.com/juergenweb/FrontendForms/blob/main/Formelements/Inputelements/Inputfields.php). There you can see that an inputfield consists of various parts (wrappers, label, error message, success message, description, notes,..) Every element can be grabed an manipulated via a get....() function getLabel() getErrorMessage() getSuccessMessage() getDescription() getNotes() getInputWrapper() getFieldWrapper() Maybe this is not well documented inside the docs, but now you know it 😉