ryanC Posted October 25, 2017 Author Posted October 25, 2017 Thanks szabesz! I appreciate your help, I'm still learning stuff I wouldn't have known otherwise here. 1
adrian Posted October 25, 2017 Posted October 25, 2017 @ryanC - I don't know what that wireMail() isn't working. I just copied the code from @szabesz's post and with the Mail Interceptor panel enabled, it returned the same result that he had - a successful mail. Just curious - did the AJAX bar appear below the main Tracy debug bar? Assuming you installed a recent version of Tracy your screenshot is showing the main Mail Interceptor panel, not the one updated by Console mail call. Actually it looks like @szabesz has an old version also. See my screenshot showing the AJAX version with (ajax) in the header: 1
szabesz Posted October 25, 2017 Posted October 25, 2017 6 minutes ago, adrian said: Actually it looks like @szabesz has an old version also. Yep, I'm still on 4.6.20.
ryanC Posted October 25, 2017 Author Posted October 25, 2017 Hi Adrian, no AJAX bar, so far I've only seen the green mail interceptor panel. I'm attaching a screenshot of what I have now:
adrian Posted October 25, 2017 Posted October 25, 2017 2 minutes ago, ryanC said: Hi Adrian, no AJAX bar, so far I've only seen the green mail interceptor panel. I'm attaching a screenshot of what I have now: Ok, it looks like you have seeing a bug there that is causing problems with the AJAX bar - we need to solve that and then hopefully you should be good. Can you please send a screenshot of the error when you hover over the SnippetRunner panel please? And also those from the "2 errors" panel. Also, can you please let me know what version of Tracy you are running?
ryanC Posted October 25, 2017 Author Posted October 25, 2017 Sure... files attached. Tracy Version: 4.6.28
adrian Posted October 25, 2017 Posted October 25, 2017 Ah - thank you. You must be using an older version of PW before there was support for $urls. My fault - I should have used the older and more compatible $config->urls. I'll post a fix shortly, but in the meantime, I think if you just disable the SnippetRunner panel, everything should work ok.
ryanC Posted October 25, 2017 Author Posted October 25, 2017 Ok, I disabled the snippet runner panel, the errors are gone but no AJAX bar or sent email yet. This is a screenshot of everything I have:
adrian Posted October 25, 2017 Posted October 25, 2017 Ok, the latest version of Tracy should fix those errors. Please update and let us know if the AJAX version of the Mail Interceptor shows the email as expected.
adrian Posted October 25, 2017 Posted October 25, 2017 Ok, it looks like your AJAX panel might not be working. Are you running PHP 5.3? If so, the AJAX panel won't work. If you are running 5.4 or greater, please check "backend" in the "Show Debug Bar" section and load the main admin page tree view and let us know if the AJAX panel shows up there.
ryanC Posted October 25, 2017 Author Posted October 25, 2017 Ok... PHP 5.610. Updated to Tracy 4.6.29... Have selected backend... Looking at all my pages and it's still just the TRACY bar by itself.
ryanC Posted October 25, 2017 Author Posted October 25, 2017 Something new happened though when I hit "run" for the email test. The console has a bunch of code there now, I didn't see that before. Actually I guess that's the default behavior for the Page view, earlier I was on the module page itself.
adrian Posted October 25, 2017 Posted October 25, 2017 6 minutes ago, ryanC said: The console has a bunch of code there now, I didn't see that before. Sorry, I don't know what you mean - can you post a screenshot and explain please? I think you definitely have some AJAX issues, but I have no idea what at the moment. Any chance this site is live somewhere I could take a look? Not that it should matter, but do you have the core SessionHandlerDB module installed? Also, what happens if you reload the page after submitting the console mail code - does the Mail panel show up populated then? Or, what about putting that code in a template file and loading a page with the template - does the main Mail panel show then?
ryanC Posted October 25, 2017 Author Posted October 25, 2017 Oops, I missed a step! I didn't "submit" when I selected Backend. Now I see the AJAX bar. That extra code was just the console showing me page names, I'm sure it's supposed to do that.
adrian Posted October 25, 2017 Posted October 25, 2017 Just now, ryanC said: Bingo: Ok, great to see that working, although I am still not sure why it didn't work on the Frontend, or has that solved itself also? But back to the original topic - this result shows that your email is successfully being prepared and sent by PW - now it's just a matter of why it isn't actually going out. I admit I didn't properly read the early posts, but if you are using WireMailSMTP, did you use the TEST option there to test your settings?
ryanC Posted October 25, 2017 Author Posted October 25, 2017 10 minutes ago, adrian said: Sorry, I don't know what you mean - can you post a screenshot and explain please? I think you definitely have some AJAX issues, but I have no idea what at the moment. Any chance this site is live somewhere I could take a look? Not that it should matter, but do you have the core SessionHandlerDB module installed? Also, what happens if you reload the page after submitting the console mail code - does the Mail panel show up populated then? Or, what about putting that code in a template file and loading a page with the template - does the main Mail panel show then? Ok... looks like we were successful here. I didn't submit but now we are up to date. Site is not live yet, and I don't have SessionHandlerDB installed.
ryanC Posted October 25, 2017 Author Posted October 25, 2017 1 minute ago, adrian said: Ok, great to see that working, although I am still not sure why it didn't work on the Frontend, or has that solved itself also? But back to the original topic - this result shows that your email is successfully being prepared and sent by PW - now it's just a matter of why it isn't actually going out. I admit I didn't properly read the early posts, but if you are using WireMailSMTP, did you use the TEST option there to test your settings? It is on Front End now, so everything you did with the update was successful. I do have WireMailSMTP installed, and after entering Gmail settings it said it the settings were correct. Let me open up the module..
ryanC Posted October 25, 2017 Author Posted October 25, 2017 WireMail SMTP, I have entires for: localhost, SMTP hostname, SMTP Port, SMTP user, SMTP password, Use SSL, SMTP Certificate... I'm assuming Sender Email Address is my own? That is in there also... so with those settings I get "Success! SMTP Settings appear to work correctly"
ryanC Posted October 25, 2017 Author Posted October 25, 2017 So I guess now it's either the PHP for my form, or the SMTP settings.
adrian Posted October 25, 2017 Posted October 25, 2017 1 minute ago, ryanC said: WireMail SMTP, I have entires for: localhost, SMTP hostname, SMTP Port, SMTP user, SMTP password, Use SSL, SMTP Certificate... I'm assuming Sender Email Address is my own? That is in there also... so with those settings I get "Success! SMTP Settings appear to work correctly" Ok, so that sounds promising. What happens if you run that Console panel code without the Mail Interceptor activated. Does the email get sent? 1
ryanC Posted October 25, 2017 Author Posted October 25, 2017 13 minutes ago, adrian said: Ok, so that sounds promising. What happens if you run that Console panel code without the Mail Interceptor activated. Does the email get sent? YES it did!!
adrian Posted October 25, 2017 Posted October 25, 2017 Just now, ryanC said: not YES it did!! Ok, so as you said, now it must be an issue with the code in your form. Can you post that?
ryanC Posted October 25, 2017 Author Posted October 25, 2017 sure, this is for the results page: <?php $email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL); if (isset($_POST['submit'])) { $to = 'me@email.com'; $subject = 'Feedback from my site'; $message = 'Name: ' . $_POST['name'] . "\r\n\r\n"; $message .='Email: ' . $_POST['email'] . "\r\n\r\n"; $message .='Comments: ' .$_POST['comments']; $mail = wireMail(); $mail->to($to)->from('me@email.com'); // all calls can be chained $mail->subject($subject); $mail->body($message); $mail->send(); } ?> form page: <div class="formWrap"> <h1>Simple Email Form 1</h1> <p><em>Most basic form possible to get email response in processwire</em></p> <form id="simpleForm1" action="http://localhost:8888/signage-B/form-response-1" method="post" target="_blank"> <label for="name">Name:</label> <input type="text" name="name" id="name"> <label for="email">Email:</label> <input type="email" name="email" id="email"><br /><br /> <label for="comments">Comments:</label> <textarea name="comments" id="comments"></textarea> <div class="submission-test"> <input type="submit" name="send" value="Submit"> </div> </form> </div>
adrian Posted October 25, 2017 Posted October 25, 2017 I think the most likely thing is that nothing is getting processed. You are checking for: if (isset($_POST['submit'])) { but you don't have a field named "submit" - take a look at the Request Info panel in Tracy under Input POST and you'll see an entry for "send", but not submit. You can also add a bd('test'); call as the first line inside the isset and you'll see that nothing will show up in the Dumps Recorder panel in Tracy, because nothing in there is being processed.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now