Your address will show here +12 34 56 78

This topic contains 4 replies, has 2 voices, and was last updated by  Anna 3 years, 7 months ago.

  • Author
    Posts
  • #20593

    Ernesto

    Hi Anna,

    in the contact form of the single property page is possible that the message gets to the mail address of the administrator as well as that of the agent?

    that is, the person receiving the message must be the administrator of the site and the agent

    thanks!

  • #20687

    crerem

    Hello,
    Yes you can do that but is not something you can do from admin area. The code need some customization

    Try to do it like this : open agentcontactform.php and on line 35 you have this
    <input name=”agent_email” type=”hidden” id=”agent_email” value=”<?php print $agent_email ?>”>

    on the value field put first the admin email then , then the original code
    something like this
    value=”[email protected],<?php print $agent_email ?>”>

    Let me know if it works

  • #20702

    Ernesto

    Thanks for the help, I tried but it does not work.

  • #20980

    Ernesto

    Oh Anna… can you help me?

  • #24700

    Anna
    Keymaster

    Hello,

    These are comments from a client who managed to do this a different way:

    “I found a new way using gravity form. Here is the way I did it in case someone need.
    First remove the default forms and replace with gravity form need 2 form one for contact and one for properties.

    After add this code in the function.php

    function change_autoresponder_email( $notification, $form) {

    //This example is using a form with the id of 1
    if($form[“id”] == 1){
    global $post;

    $agent_email = get_post_meta( $post->ID , ‘agent_email’, true );
    $notification[‘to’] = $agent_email;

    return $notification;
    }

    //This example is using a form with the id of 1
    if($form[“id”] == 2){
    global $post;

    $agent_email_one = get_the_author_meta(’email’, $post->post_author);
    $notification[‘to’] = $agent_email_one;
    return $notification;
    }
    }
    add_filter(‘gform_notification’, ‘change_autoresponder_email’, 10, 3);

You must be logged in to reply to this topic.