Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
    Posts
  • #289936

    Hi..

    I need to have some indicator text inside the email or subject.
    I tried to set E-mail Subject, but what i get is just the subject from the contact form.
    I tried to use custom HTML, it’s in the form but not showed in the email.
    How to do?

    Thanks

    #290141

    Hi dewasurya!

    Do you mean placeholder? If so, please add following code to Functions.php file inside Appearance > Editor

    function add_custom_script(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery('input#avia_name_1').attr('placeholder', 'Name *');
    jQuery('input#avia_e-mail_1').attr('placeholder', 'E-mail *');
    jQuery('textarea#avia_message_1').attr('placeholder', 'Your message *');
    jQuery('input#avia_subject_1').attr('placeholder', 'Your subject *'); 
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    Regards,
    Yigit

    #290866

    Hi,

    I might do something wrong. Once I paste the code it makes my sites blank. Please have a try with the login info i gave you.

    Thanks,
    Surya

    #290925

    Hey Surya!

    Please check your website now. I have successfully added the code to functions.php file

    Best regards,
    Yigit

    #290941

    Hi..

    Thank you,
    so how this is work? I just tried to send an email, but there is no indicator showing that it is came from this contact form.

    Name: test4
    E-Mail: (Email address hidden if logged out)
    Subject: testing email subject 4

    Message: test ajaahhh

    I need something written inside the email that I receive. For example under the message there is always text says “email from contact us”. Then in another contact form in different page, there is another text says something else. Therefore I can give indicator which email came from which contact form

    #291734

    Hi!

    Please try to insert this cpode into the enfold/functions.php file – it should change the subject to “New message sent by contact form at XXX” and instead of XXX the page title of the contact form page will be used.

    
    add_filter('avf_form_subject', 'avia_change_subject', 10, 3);
    function avia_change_subject($subject, $new_post, $params){
            $subject =  __("New Message", 'avia_framework') . " (".__('sent by contact form at','avia_framework')." ".get_the_title().")";
            return esc_html($subject);
    }
    

    Best regards,
    Peter

    #291954

    Hi Peter,

    Thank you for your help. But it change the mail subject completely, and each new message always has the same subject. This is not what I mean. Sorry for the confusion.
    If you see contact form 7. you can define some text in message body:

    This e-mail was sent from a Promo Blast on Villa Bugis (http://villabugis.com)

    The same with this, I need to add some text after all message defined by all fields in your contact form. I don’t want to use contact form 7 as contact form 7 could not redirect the page to another page after submit.

    Sorry for my bad English, hope you understand.

    Regards,
    Surya

    #292303

    Hi Surya,

    Open /framework/php/class-form-generator.php and look for line 713:

    $message = stripslashes($message);
    

    Replace it by this:

    $message = apply_filters("avf_form_message", stripslashes($message), $new_post, $this->form_params);
    

    Then add this to the theme functions.php:

    function change_form_message($message) {
    	$message .= "<br>- This e-mail was sent from a Promo Blast on Villa Bugis (http://villabugis.com)";
    	return $message;
    }
    add_filter('avf_form_message', 'change_form_message');
    

    Change as needed.

    Regards,
    Josue

    #292776

    Hi Josue,

    Thank you.
    It works, however, it just work if I change the class-form-generator.php in the main theme. I can’t apply it from child theme? I’m afraid it will gone in the next theme update.
    And as the additional message is set in function.php, it apply for all contact form in all pages, we need to make the text different, depend on the page. Is that possible?

    Regards,
    Surya

    #293281

    Hey!

    You can copy the entire code of /framework/php/class-form-generator.php into your child theme functions.php file. Then the next theme update won’t overwrite your modified code.

    Regards,
    Peter

    #293282

    Hey!

    If you want to set a different message for different pages try to use the is_page() conditional: http://codex.wordpress.org/Function_Reference/is_page

    Use it like

    
    function change_form_message($message) {
    	$message .= "<br>- This is the standard message which will be used if no condition applies (http://villabugis.com)";
    	if(is_page(42)) $message .= "<br>- This e-mail was sent from a Promo Blast on Villa Bugis (http://villabugis.com)";
    	if(is_page(45)) $message .= "<br>- This e-mail was sent from a another page (http://villabugis.com)";
    	if(is_page(50)) $message .= "<br>- This e-mail was sent from yet another page (http://villabugis.com)";
    	return $message;
    }
    add_filter('avf_form_message', 'change_form_message');
    
    

    The first message will be used if the message was not send from a contact form on page 42 or 45 or 50. If a contact form on page 42, 45, 50 is used the message will change. You can replace the message strings with your custom text and change the page ids (42, 45, 50) to the page ids of your contact form pages.
    Regards,
    Peter

    #302407

    Hi Dude,

    Thank you so much for your help. It’s a charm!

    I have now some similar thing but in the different level, please advise if you could help.
    I have set some parameters in the front page using plugin insert php, to catch the source of the person who contact us, to know that our adwords is worth or not.
    here is the parameters:
    [insert_php]
    @session_start();
    if(isset($_SESSION[‘src’]) && isset($_SESSION[‘adid’])) {
    $_SESSION[‘src’] = $_GET[‘src’];
    $_SESSION[‘adid’] = $_GET[‘adid’];
    } else {
    $_SESSION[‘src’] = ”;
    $_SESSION[‘adid’] = ”;
    }
    [/insert_php]

    Then I need the text in the message to be the result of the parameters instead of the current plain text message:
    session_start();
    $_SESSION[‘src’] = $_GET[‘src’];
    $_SESSION[‘adid’] = $_GET[‘adid’];
    echo “SRC= “.$_SESSION[‘src’].” ADID= “.$_SESSION[‘adid’];

    Please help if possible.

    Regards,
    Surya

    #303005

    Hey Surya!

    Try putting the session code in the functions.php alongside the change_form_message function.

    Regards,
    Josue

    #305525

    Hi Josue,

    Thank you.
    I tried couple ways putting the codes, but ended with blank page.

    We like to have something like this inside the Email Form:
    [insert_php]
    session_start();
    echo “SRC= “.$_SESSION[‘src’].” ADID= “.$_SESSION[‘adid’];
    $ip = getenv(‘REMOTE_ADDR’);
    $time = date(“M j G:i:s Y”);
    $fwrite=fopen(“/home/villabug/public_html/wp-content/prospects.txt”,”a+”);
    fwrite($fwrite, “T=”.$time.”\t IP=”.$ip.”\t EMAIL= SOURCE=”.$_SESSION[‘src’].” ADID=”.$_SESSION[‘adid’].”\n”);
    fclose($fwrite);
    [/insert_php]

    Hhow we can assign the EMAIL address that’s captured on http://villabugis.com/contact-us/ to a PHP session variable e.g. $_SESSION[’email’]?

    Regards,
    Surya

    #305526

    Hey Surya!

    This could work:

    $_SESSION['email'] = $_POST['avia_e-mail_1'];
    

    Regards,
    Josue

    #305600

    Hi Josue,
    Could you please let me know where this code should exactly should be located?

    Thanks,
    Surya

    #305978

    Hi Surya!

    Hm, i couldn’t tell to be honest because i did not craft that custom code and i don’t know what exactly it does, i’ve just answered to:

    how we can assign the EMAIL address that’s captured on http://villabugis.com/contact-us/ to a PHP session variable e.g. $_SESSION[’email’]?

    Best regards,
    Josue

    #306163

    Hi Josue,

    Sorry for being pain.
    Actually we would like to track the source from where they find our website. We need to grab the cookies and insert it inside the email that visitor submitted from your contact form.
    We have manage to write some texts in the contact form, but now we would like to replace the text with the cookies, then we are able to get the tracking for every conversion.

    If I may ask, how we can output the content from the Contact Us form to a local file at the same time as generating an email to our email address? So we dont need to assign email to PHP, and we just need to write the content to a file which will include the email (plus name, subject, message)?

    Or do you have any other suggestion?

    Thank you.
    Surya

    #306521

    Hello Surya,

    To set a cookie you can use the setcookie function. It’s worth noting that this request has already gone outside the support coverage we can offer, if you need additional help please contact a developer from Codeable or Envato Studio.

    Best regards,
    Josue

    #325885

    Thanks so much I chose the script that @Dude put up and it worked like a charm now all forms in the widget section show the page they came from I LOVE ENFOLD

Viewing 20 posts - 1 through 20 (of 20 total)
  • The topic ‘Contact form Indicator’ is closed to new replies.