Home › Forums › Community Forum › Registration Wont Update Mailchimp Merge Tags
Tagged: custom_fields, mailchimp, merge
This topic contains 36 replies, has 5 voices. Last updated by Cristián Lávaque 4 years, 8 months ago.
| Topic Author | Topic |
|---|---|
| Posted: Friday Mar 23rd, 2012 at 9:03 am #8905 | |
|
|
|
|
Okay, so here’s what I’m trying to do 1) user registers on my registration page, and fill out 2 custom fields (budget, weight goal) 2) i created a file /wp-content/mu-plugins/s2hacks.php that is supposed to update mailchimp upon registration
3) mailchimp is not receiving these additional 2 fields both named “BUDGET” and “WTGOAL” 4) s2member IS receiving my input data as evidence by this function
whose output is
Can you please tell me what I’m missing in the s2-hacks.php file? |
|
List Of Topic Replies
| Author | Replies |
|---|---|
| Author | Replies |
| Posted: Friday Mar 23rd, 2012 at 9:00 pm #8981 | |
|
|
|
|
Hi Andrew. Have you created the “BUDGET” and “WTGOAL” merge fields in MailChimp? |
|
| Posted: Saturday Mar 24th, 2012 at 8:27 am #9009 | |
|
|
|
|
These fields exist in mailchimp. |
|
| Posted: Saturday Mar 24th, 2012 at 4:17 pm #9016 | |
|
|
|
|
Got it. Just to check if the arrays are what they’re supposed to be, after the line [hilite pre_code]$my_custom_merge_vars = array("BUDGET" => $budget, "WTGOAL" => $wtgoal); [/hilite] could you add these as a test? [hilite pre_code] '; |
|
| Posted: Saturday Mar 24th, 2012 at 5:43 pm #9017 | |
|
|
|
|
I added that and registered on the site but I’m not seeing where this information should be printed. |
|
| Posted: Sunday Mar 25th, 2012 at 2:06 am #9026 | |
|
|
|
|
Hmm… I think I see what the problem is with the hack. It’s missing the priority and number of arguments in the [hilite mono]add_filter[/hilite] function call. http://codex.wordpress.org/Function_Reference/add_filter Try this, please: [hilite pre_code]$budget, 'WTGOAL' => $wtgoal)); } ?> [/hilite] |
|
| Posted: Sunday Mar 25th, 2012 at 11:03 am #9042 | |
|
|
|
|
Dang, just updated it with the code above and still nothing. |
|
| Posted: Sunday Mar 25th, 2012 at 7:44 pm #9070 | |
|
|
|
|
Hmm… I think [hilite mono]get_user_field[/hilite] is being used wrongly, cause it doesn’t have access to the specific fields like that, you have to get the whole array of custom fields getting [hilite mono]s2member_custom_fields[/hilite]. How about this? [hilite pre_code]$cfields['budget'], 'WTGOAL' => $cfields['wtgoal'])); } ?> [/hilite] |
|
| Posted: Monday Mar 26th, 2012 at 8:17 am #9104 | |
|
|
|
|
Success! It worked. Do you know why it wasn’t working previously? Was the original code sample I used from an older version of the plugin? I’m just trying to learn more about how the plugin is built so I can continue to bolt on the features I need. |
|
| Posted: Monday Mar 26th, 2012 at 8:53 am #9105 | |
|
|
|
|
Only somewhat related to this but i like what i see. I wonder if this kind of coding could be used to automatically fill merge tags in MC with the date of registration/purchase of a certain product (based on ccaps)? If so (and if it is not already included in the next major release) i might look into that.
|
|
| Posted: Monday Mar 26th, 2012 at 9:04 am #9107 | |
|
|
|
Great! :) Right, seems to have been an outdated script. I guess the function changed since then, I just noticed the mistake yesterday when I reviewed its documentation again after a long time.
Yes, you can adapt the hack to store other values, like registration dates. |
|
| Posted: Monday Mar 26th, 2012 at 9:04 am #9108 | |
|
|
|
|
Perfect, thanks so much for the help! |
|
| Posted: Monday Mar 26th, 2012 at 9:13 am #9110 | |
|
|
|
Any info whether it is included in the next release before i get into coding? |
|
| Posted: Monday Mar 26th, 2012 at 9:20 am #9111 | |
|
|
|
You’re welcome! I’m glad I could help you. :)
Heh, there’s a good chance. There will be a big improvement for this, but I’m not sure if it’ll include payment times, so you may still need to use a hack. Anyway, this hack is quite simple, so it won’t take you too long to implement now, or update later. ;) |
|
| Posted: Monday Mar 26th, 2012 at 9:24 am #9112 | |
|
|
|
Great to know. I might just get to learn more coding, even if just for the “fun” of it! :) |
|
| Posted: Monday Mar 26th, 2012 at 9:39 am #9113 | |
|
|
|
|
:) |
|
| Posted: Monday Mar 26th, 2012 at 2:04 pm #9127 | |
|
|
|
|
As an add-on to this question, can you help me, here’s what I’m trying to do. 1) user registers for the site by replicating the signup form 2) user details are sent to mailchimp (as completed in the above function) 3) i then take the user to a survey where they have to fill out 5-6 additional questions 4) user submits their information, its stored in s2member_custom_fields 5) the information is then sent to mailchimp to sync — Basically I just need to be able to run the mailchimp_merge_array through some sort of PHP call so I can sync the data in the wordpress database with what Mailchimp has |
|
| Posted: Monday Mar 26th, 2012 at 2:36 pm #9131 | |
|
|
|
|
You may want to try using this method, which is the one that does the job during registration, only you’d call it at some other time: [hilite mono]c_ws_plugin__s2member_list_servers::process_list_servers[/hilite] |
|
| Posted: Monday Mar 26th, 2012 at 4:11 pm #9137 | |
|
|
|
|
Cristian, can you explain how to use this function? Here is what I have
and then in s2-hacks.php i have this
When I check for the user details in Mailchimp its not updating the.m
|
|
| Posted: Tuesday Mar 27th, 2012 at 2:02 am #9171 | |
|
|
|
|
Sorry, I can’t help with that. :/ If you need a developer’s help, you could find good freelancers in sites like oDesk.com, eLance.com or jobs.wordpress.net. I hope that helps. :) |
|
| Posted: Tuesday Mar 27th, 2012 at 7:15 am #9201 | |
|
|
|
|
Cristian, thanks for the help well I guess my question is for this function to work properly can you show me an example request? When I ran it above, I only had 2 parameters included, but I’m assuming I need to have all of the parameters included to have this function initiate itself? |
|
| Posted: Tuesday Mar 27th, 2012 at 3:12 pm #9268 | |
|
|
|
|
[hilite pre_code]
$cfields = get_user_option('wp_s2member_custom_fields', $vars['user_id']); [/hilite] will give you all the custom fields that have a value for the user, not just budget and wtgoal. You can add more of those to the array to be merged. Is that what you meant?
|
|
| Posted: Tuesday Mar 27th, 2012 at 3:15 pm #9271 | |
|
|
|
|
Can you show me how to use this function?
i’ve got everything filled out except the password, but its not working, so i must be missing something
|
|
| Posted: Thursday Mar 29th, 2012 at 5:08 am #9437 | |
|
|
|
|
I asked Jason about using [hilite mono]c_ws_plugin__s2member_list_servers::process_list_servers[/hilite] and if all arguments were required to make it work, including password. Here’s his reply:
|
|
| Posted: Thursday Mar 29th, 2012 at 11:22 am #9464 | |
|
|
|
|
Thanks for the help, I think I’m almost there. To run this function, do I have to add in a filter? I’m trying to just call it on a random page on my site, but its throwing an error (which i cant see because my shared server does not show php erros). Here is what I’m calling, and all variables have content.
|
|
| Posted: Thursday Mar 29th, 2012 at 4:32 pm #9488 | |
|
|
|
|
This should help: http://google.com/search?q=wordpress+show+php+errors |
|
This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.








Pre-Sale FAQs
Video Tutorials
Community Forum
Knowledge Base
News/Updates
s2 Codex / Docs
GPL v2 License
Contact A Human
About Us
Our Customers
Support Policy
Privacy Policy
