Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1162228

    I use the newsletter registration in a member area for logged in users. The essential user data (email, first name, last name …) are known. This allows me to fill in the form. I simply copy and paste the form via shortcode according to the following pattern:

    
    $email = $current_user->user_email;
    <form action="..." method="post" data-av-custom-send="mailchimp_send" ...>
    ...
    <input name="avia_0_1" class="text_input is_email" type="text" id="avia_0_1" value="' . $email . '" />
    ...
    </form>
    

    It works. However, I still need a hidden real layout builder form on the site to select the newsletters list.

    Is there a more elegant method (filter) to fill the form automatically. Could you please show me the code snippets. I still have 2 extra fields (text and dropdown).

    Regards
    Günter

    #1163321

    Hey Günter,

    Thank you for the inquiry.

    Where can we see the form? What do you mean by “hidden real layout builder form”? A screenshot or a link to the actual page containing the form will help.

    Best regards,
    Ismael

    #1163498

    Plan A

    I am looking for a way to fill in the fields of the form with known values. I do not know the correct syntax.
    I am looking for a correct syntax for the lines between comment lines:

    
    function set_mailchimp_values() {
     // Is that possible? 
     $values = array( field nameA, type='text', value = 'VARIABLE1',
                      field nameB, type='dropdown', value = 'VARIABLE2',
                      etc.,
                      )
     return $values;
     // How do I set these values?
     }
    add_action( 'ava_mailchimp_contact_form_elements', 'set_mailchimp_values' );
    

    Plan B
    Because I do not know how to set the values with Action / Filter, I chose the described variant. Hidden form means “display: none;”

    Please help me to realize Plan A.
    Günter

    #1163602

    Hi Günter,

    Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you or use a plugin that has the function to add such values :)

    Best regards,
    Victoria

    #1163632

    Hi Victoria,

    pity, but the less elegant version with the manually copied form works yes.

    Thanks anyway
    Günter

    #1163652

    Hi Günter,

    Well, you can look at this file too if your php is strong enough
    /enfold/config-templatebuilder/avia-shortcodes/mailchimp/mailchimp.php

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1164037

    Hi Victoria,

    thanks for the tip. I still found a solution without php knowledge. In the shortcode, the individual fields have an option value. I have packed the newsletter shortcode into a new shortcode and can thus enter the values for the individual fields as a variable, for example: [av_mailchimp_field id = '0' label = 'Email Address' type = 'text' value = '$email' disabled = '' check = 'is_email'] .

    Best regards
    Günter

    #1164139

    Hi Günter,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

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