Hello,
I am using MailPress for a client's Newsletter system and I want to take the emails from Gravity Forms on my site and insert them into the Mail Press user database. I am successfully gotten Mail Press to create a new entry when a form is submitted but it is not actually inputting the email and name which I have saved as custom fields. Can someone please take a look at this function, specifically the part that calls the custom fields, and let me know what is going wrong. Thanks!
add_filter("gform_post_submission", "MailPress_add_user_form", 10, 2);
function MailPress_add_user_form($post, $form) {
$name = get_post_meta($post['post_id'], 'user_name', true);
$email = get_post_meta($post['post_id'], 'user_email', true);
MailPress::require_class('Users');
$user_check = MP_Users::get_id_by_email($_REQUEST['cemail']);
if ($user_check == NULL) {
$mp_user_id = MP_Users::insert($email, $name, md5(uniqid(rand(),1)),'active' );
}
}