Okay
  Public Ticket #913961
Contact Form Subject Field Bug
Closed

Comments

  •  2
    motiv_studio started the conversation

    The subject field is not being sent properly from the Contact Form (Visual Composer). I sent myself several test messages and in all of them, rather than displaying the actual subject, "Test message #3", it would show: 

    "Subject: [Name Field] New Contact Form message has been received."

  • [deleted] replied

    Hi,

    To add the contact form subject line, add the following snipped in functions.php

    function set_subject_in_contact_form_mail( $subject, $data ) {

    if ( ! empty( $data['subject_title'] ) ) {
    $subject = $data['subject_title'];
    }

    return $subject;
    }

    add_filter( 'kalium_contact_form_subject', 'set_subject_in_contact_form_mail', 100, 2 );

    Also replace this file:

    Download this file and replace it in this directory (of the theme): /kalium/inc/lib/vc/lab_contact_form

  •  2
    motiv_studio replied

    Hello,

    It does not seem like the solution you provided has worked. Now, the email subject is blank, and the subject in the message body is still "Subject: [Name Field] New Contact Form message has been received." I have uploaded two screenshots to demonstrate.

  •  2
    motiv_studio replied

    Here are the screenshots. One is of the actual contact form, and the other is the email that was sent as a result.

  • [deleted] replied

    Hi,

    I have changed the code I gave to you to this form:

    // Add subject title to contact form
    function set_subject_in_contact_form_mail( $subject, $data ) {
    $_subject = post( 'subject' );

    if ( ! empty( $_subject ) ) {
    $subject = $_subject;
    }
    return $subject;
    }

    add_filter( 'kalium_contact_form_subject', 'set_subject_in_contact_form_mail', 100, 2 );

    And now the subject line is inherited from contact form fields.

  •  2
    motiv_studio replied

    The actual email subject is now set to the contact form's subject field. But in the email's message body, the subject is still "[Blog Name] New Contact Form message has been received.", which makes no sense, design-wise.

    I'm trying to modify the init.php file myself but it is confusing. Please have the email subject set to "[Blog Name] New Contact Form message has been received." and display the form's subject field within the email's message body.

    Thanks

  • [deleted] replied

    Hi 

    Here is an example that the code I've sent you already works, I've showed you all the steps in this screen recording:

    http://drops.laborator.co/19Fws

    Have you followed the same steps?

  • [deleted] replied

    Hi,

    Oh now I understand the point, will send you the fix for that.

  •  2
    motiv_studio replied

    I will wait for your fix then.

  • [deleted] replied

    Hi,

    I've applied the fix, can you try and see if everything is working fine now?

  •  2
    motiv_studio replied

    The subject field in the message has been completely removed now.

  •  2
    motiv_studio replied

    Please see attached screenshot. This is how it should be designed.

  • [deleted] replied

    Hi,

    I wasn't able to login to your FTP and test the issue.

    Can you please tell me exactly what do you want to see in the Email subject, and what in the Email message/body, enter a sample example here so I will now what to do.

  •  2
    motiv_studio replied

    I have reset the FTP login information back to before.

    The format of the email should be:

    Subject: [Website Name] New Contact Form Message Received

    Message Body:

    You have received a new contact form message. 

    ----- Message Details ----- 

    Full Name: [Name] 

    Email: [Email]

    Subject: [Contact Form Subject]

    Message: 

    [Contact Form Message]

    This message has been sent from IP: [IP Address] 

    Site URL: http://clarklai.com


  • [deleted] replied

    Hi,

    Fixed it, see example email:


    (view large version)

    It was a theme bug and it will be contained in the upcoming updates as well.

  •  2
    motiv_studio replied

    Hi Arlind,

    Looks like everything displaying properly.

    Thank you, and looking forward to Kalium 2.0!

  •   [deleted] replied privately
  •  2
    motiv_studio replied

    Hello Arlind,

    It looks like in the recent updates this bug was not fixed and it the fix you had provided had been overwritten. If you could please provide a fix, it would be appreciated.

    Thank you

  • [deleted] replied

    Hi,

    Sure here it is:

    Download this file and replace it in this directory (of the theme): /inc/lib/vc/lab_contact_form