Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
649 views
in Q2A Core by
There is a confirmation(request) about email-address of feedback.
If email is not blank, hope to check it before qa_send_email() like user's registration. Now, if email-address is invalid, transmit it(?).

Thanks in advance.

1 Answer

+3 votes
by
Yes, if the email address is invalid, the feedback message is still sent, but the email is not used as the 'From' address on the message. I believe this is sensible behavior because (in my experience) it is more important to get feedback from your users than make sure that they enter their email correctly.

But you can change this if you like by adding the following:

if ( (!empty($inemail)) && !qa_email_validate($inemail) )
    $errors['email']=qa_lang('users/email_invalid');

... after ...

if (empty($inmessage))
    $errors['message']=qa_lang('main/feedback_empty');

... and also adding this in the 'email' => array(...) lower down:

'error' => qa_html(@$errors['email']),

[I've not checked this code, so apologies for any errors...]
...