-
AuthorPosts
-
December 3, 2019 at 3:31 pm #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ünterDecember 6, 2019 at 7:03 am #1163321Hey 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,
IsmaelDecember 7, 2019 at 12:33 am #1163498Plan 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ünterDecember 7, 2019 at 3:47 pm #1163602Hi 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,
VictoriaDecember 7, 2019 at 4:30 pm #1163632Hi Victoria,
pity, but the less elegant version with the manually copied form works yes.
Thanks anyway
GünterDecember 7, 2019 at 5:32 pm #1163652Hi Günter,
Well, you can look at this file too if your php is strong enough
/enfold/config-templatebuilder/avia-shortcodes/mailchimp/mailchimp.phpIf you need further assistance please let us know.
Best regards,
VictoriaDecember 9, 2019 at 2:40 pm #1164037Hi 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ünterDecember 9, 2019 at 7:44 pm #1164139Hi Günter,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.