Closed michaelhagedon closed 9 years ago
@michaelhagedon, this looks good to me, but I'm having some trouble with the email functionality on my local build. I will look at this as soon as I have that fixed.
@michaelhagedon The feedback mail functionality seems to be broken for me. I've tried it both on webdev and my local build with no luck. I checked the logs and saw
2015-02-11 11:04:09 Error: [SocketException] Invalid email: ""
Request URL: /applications/quickHelp/tutorials/provide_feedback/336
Are you still getting spam messages?
Are the email settings in config.yml filled out?
From: Will Simpson [mailto:notifications@github.com] Sent: Wednesday, February 11, 2015 11:10 AM To: ualibraries/Guide-on-the-Side Cc: Hagedon, Mike - (mhagedon) Subject: Re: [Guide-on-the-Side] Add honeypot spam protection to fix #113. (#114)
@michaelhagedonhttps://github.com/michaelhagedon The feedback mail functionality seems to be broken for me. I've tried it both on webdev and my local build with no luck. I checked the logs and saw
2015-02-11 11:04:09 Error: [SocketException] Invalid email: ""
Request URL: /applications/quickHelp/tutorials/provide_feedback/336
Are you still getting spam messages?
— Reply to this email directly or view it on GitHubhttps://github.com/ualibraries/Guide-on-the-Side/pull/114#issuecomment-73931920.
@michaelhagedon My local settings are:
email:
# smtp (recommended) or php
transport: smtp
send_from: lbry-webadmin@email.arizona.edu
send_all_feedback_to: wss.simpson@gmail.com
log: false
The webdev settings are:
email:
send_from: webadmin@u.library.arizona.edu
#send_all_feedback_to: hagedonm@u.library.arizona.edu
send_all_feedback_to: wss.simpson@gmail.com
I seem to be able to get the completion certificates without issue.
@simpsonw I won't know about spam until we put it in production. :-)
On this branch I was able to get mail on localhost sending through gmail.
@michaelhagedon I think I've figured out the problem. The issue is that the feedback email will fail if the tutorial in question doesn't have a contact_email associated with it. The behavior I was seeing didn't even give the user an error message; the form simply appeared to do nothing after you clicked submit. The culprit is the call to addBcc on line 933 of the TutorialsController. If you don't have a contact_email specified, it gets passed an empty string and then fails, but since it's outside of the try/catch block that send the success/failure message back to the browser, you don't have any idea what's going on.
Seeing as how this field is optional/nullable in the database, I think we should probably check to make sure it's not empty before sending the email.
Since the bug I was talking about previously doesn't really seem to have anything directly to do with this pull request, I've decided to make a separate issue (#115) to deal with it. I will manually fixed the merge issue, review it, and commit/merge as appropriate.
FYI, this has been deployed to the UAL production server.
I'm tired of getting spam. :-)