How to change who the sidebar contact forms go to

Home Forums All Other Themes How to change who the sidebar contact forms go to

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #98816
    mcasciomcascio
    Participant
    • Topics: 4
    • Replies: 7
    • Total: 11
    Member since: August 23, 2017

    The theme SKT Architect Pro has the “default template” pages set up to include a right sidebar with a contact form. How do we change who these contact forms go to?
    I did not see contact form under widgets.

    #98851
    Sonl SinhaSonl Sinha
    Moderator
    • Topics: 0
    • Replies: 31028
    • Total: 31028
    Member since: August 16, 2013

    Hi,

    Kindly show us your website URL?

    Regards,
    Brad

    #98900
    mcasciomcascio
    Participant
    • Topics: 4
    • Replies: 7
    • Total: 11
    Member since: August 23, 2017

    https://lailta.org/

    #98936
    Sonl SinhaSonl Sinha
    Moderator
    • Topics: 0
    • Replies: 31028
    • Total: 31028
    Member since: August 16, 2013

    Hi,

    Kindly go to >> inc/custom-functions.php and find text “Contact Form” and change there.

    Regards,
    Brad

    #98964
    mcasciomcascio
    Participant
    • Topics: 4
    • Replies: 7
    • Total: 11
    Member since: August 23, 2017

    Hello thank you. I found the reference to the contact form in that file, but I am unsure where to place the actual recipient emails?

    I attempted to replace ‘admin_email’ on the third line here with my email address and then tested the form, but I received nothing. I am also unsure why it wouldn’t send to the admin email (mine) in the first place.

    function contactform_func( $atts ) {
    $atts = shortcode_atts( array(
    ‘to_email’ => get_bloginfo(‘admin_email’),
    ‘title’ => ‘Contact enquiry – ‘.home_url( ‘/’ ),
    ), $atts );

    $cform = “<div class=\”main-form-area\” id=\”contactform_main\”>”;

    $cerr = array();
    if( isset($_POST[‘c_submit’]) && $_POST[‘c_submit’]==’Submit’ ){
    $name = trim( $_POST[‘c_name’] );
    $email = trim( $_POST[‘c_email’] );
    $phone = trim( $_POST[‘c_phone’] );
    $website = trim( $_POST[‘c_website’] );
    $comments = trim( $_POST[‘c_comments’] );
    $captcha = trim( $_POST[‘c_captcha’] );
    $captcha_cnf = trim( $_POST[‘c_captcha_confirm’] );

    if( !$name )
    $cerr[‘name’] = ‘Please enter your name.’;
    if( ! filter_var($email, FILTER_VALIDATE_EMAIL) )
    $cerr[’email’] = ‘Please enter a valid email.’;
    if( !$phone )
    $cerr[‘phone’] = ‘Please enter your phone number.’;
    if( !$comments )
    $cerr[‘comments’] = ‘Please enter your message.’;
    if( !$captcha || (md5($captcha) != $captcha_cnf) )
    $cerr[‘captcha’] = ‘Please enter the correct answer.’;

    if( count($cerr) == 0 ){
    $subject = $atts[‘title’];
    $headers = “From: “.$name.” <” . strip_tags($email) . “>\r\n”;
    $headers .= “MIME-Version: 1.0\r\n”;
    $headers .= “Content-type: text/html; charset=iso-8859-1\r\n”;

    $message = ‘<html><body>
    <table>
    <tr><td>Name: </td><td>’.$name.'</td></tr>
    <tr><td>Email: </td><td>’.$email.'</td></tr>
    <tr><td>Phone: </td><td>’.$phone.'</td></tr>
    <tr><td>Website: </td><td>’.$website.'</td></tr>
    <tr><td>Message: </td><td>’.$comments.'</td></tr>
    </table>
    </body>
    </html>’;
    mail( $atts[‘to_email’], $subject, $message, $headers);
    $cform .= ‘<div class=”success_msg”>Thank you! A representative will get back to you very shortly.</div>’;
    unset( $name, $email, $phone, $website, $comments, $captcha );
    }else{
    $cform .= ‘<div class=”error_msg”>’;
    $cform .= implode(‘<br />’,$cerr);
    $cform .= ‘</div>’;
    }
    }

    $capNum1 = rand(1,4);
    $capNum2 = rand(1,5);
    $capSum = $capNum1 + $capNum2;
    $sumStr = $capNum1.” + “.$capNum2 .” = “;

    $cform .= “<form name=\”contactform\” action=\”#contactform_main\” method=\”post\”>
    <p><input type=\”text\” name=\”c_name\” value=\””. ( ( empty($name) == false ) ? $name : “” ) .”\” placeholder=\”Name\” /></p>
    <p><input type=\”email\” name=\”c_email\” value=\””. ( ( empty($email) == false ) ? $email : “” ) .”\” placeholder=\”Email\” /></p><div class=\”clear\”></div>
    <p><input type=\”tel\” name=\”c_phone\” value=\””. ( ( empty($phone) == false ) ? $phone : “” ) .”\” placeholder=\”Phone\” /></p>
    <p><input type=\”url\” name=\”c_website\” value=\””. ( ( empty($website) == false ) ? $website : “” ) .”\” placeholder=\”Website with prefix http://\” /></p><div class=\”clear\”></div>
    <p><textarea name=\”c_comments\” placeholder=\”Message\”>”. ( ( empty($comments) == false ) ? $comments : “” ) .”</textarea></p><div class=\”clear\”></div>”;
    $cform .= “<p><span class=\”capcode\”>$sumStr</span><input type=\”text\” placeholder=\”Captcha\” value=\””. ( ( empty($captcha) == false ) ? $captcha : “” ) .”\” name=\”c_captcha\” /><input type=\”hidden\” name=\”c_captcha_confirm\” value=\””. md5($capSum).”\”></p><div class=\”clear\”></div>”;
    $cform .= “<p class=\”sub\”><input type=\”submit\” name=\”c_submit\” value=\”Submit\” class=\”search-submit\” /></p>
    </form>
    </div>”;

    return $cform;
    }
    add_shortcode( ‘contactform’, ‘contactform_func’ );

    #98991
    Sonl SinhaSonl Sinha
    Moderator
    • Topics: 0
    • Replies: 31028
    • Total: 31028
    Member since: August 16, 2013

    Hi,

    Do you want to change Email Address or form fields?

    Regards,
    Brad

    #99049
    mcasciomcascio
    Participant
    • Topics: 4
    • Replies: 7
    • Total: 11
    Member since: August 23, 2017

    I’d like to know how to edit both the form fields and the email addresses this form is going to if possible, but my main question was how do I know who this email is going to/how do I change it or add more recipients.

    #99108
    Sonl SinhaSonl Sinha
    Keymaster
    • Topics: 10
    • Replies: 6987
    • Total: 6997
    Member since: June 12, 2013

    Hi,

    You can point the default form that comes on the sidebar to email address of admin which is given in WordPress admin>settings>general.

    In case you want to replace the form with some other fields without handling code then here’s a method:

    Kindly use page template full wide in pages>edit>right sidebar under page attributes>select full width template to have no sidebar. Or else go to appearance>widgets and then add some contact form plugin widget in page sidebar area to get rid of the default contact form widget and instead show what you add there.

    Regards,
    Shri

    #99252
    mcasciomcascio
    Participant
    • Topics: 4
    • Replies: 7
    • Total: 11
    Member since: August 23, 2017

    Hello,

    Thank you for your reply. As mentioned my, email is set up as the admin email to receive notifications through the site (which I already added under Admin>settings>General>”Email Address” when the site was set up).

    Upon sending a test email through the form multiple times, I received nothing (also not in my spam folder). We would also like to have this contact form go to more than one email.

    Is there a way to figure out why nothing is happening?

    #99318
    Sonl SinhaSonl Sinha
    Moderator
    • Topics: 0
    • Replies: 31028
    • Total: 31028
    Member since: August 16, 2013

    Hi,

    Kindly use this plugin: https://wordpress.org/plugins/contact-form-7/

    Regards,
    Brad

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.