Description
Process a contact form submissionHandle the contact form submission
- Check fields
- Perform spam checking
- Send email, copying user if required
- Display "thank you" message
- bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
- oiku_akismet_check() – Perform an akismet check on the message, if it’s activated
- oiku_get_message() – Return the sanitized message text
- oiku_get_subject() – Return the sanitized message subject
- oiku_send_email() – Build and send an email with fields substituted by default
- oiku_thankyou_message() – Display a "thank you" message
- p() – Output a paragraph of translatable text
Usage
_oiku_process_contact_form_oik();Parameters
Returns
voidSource
File name: oik-user/shortcodes/oik-contact-user.phpLines:
1 to 24 of 24
function _oiku_process_contact_form_oik() { oik_require( "includes/oik-user-email.inc", "oik-user" ); $email_to = bw_array_get( $_REQUEST, "oiku_email_to", null ); $message = oiku_get_message(); if ( $email_to && $message ) { $fields = array(); $subject = oiku_get_subject(); $fields['message'] = $message; $fields['contact'] = bw_array_get( $_REQUEST, "oiku_name", null ); $fields['from'] = bw_array_get( $_REQUEST, "oiku_email", null ); $send = oiku_akismet_check( $fields ); if ( $send ) { $sent = oiku_send_email( $email_to, $subject, $message, null, $fields ); } else { $sent = true; // Pretend we sent it. } oiku_thankyou_message( $fields, $send, $sent ); } else { $sent = false; p( "Invalid. Please corrrect and retry." ); } return( $sent ); }View on GitHub
Invoked by
Calls
1 to 7 of 7
