Plugin Author
jessepearson
(@jessepearson)
Automattic Happiness Engineer
You’re welcome 🙂
I believe this plugin was originally created to bridge a small gap between contact forms and the newsletter sign up, and as such, it has little functionality. I personally got involved because it wasn’t working for my client and it was easier to fix this plugin than it was to write my own.
That being said, here’s the code that gets the form info for name and email to post over to MailPoet:
// set defaults for mailpoet user data
$user_data = array(
'email' => "",
'firstname' => "",
'lastname' => ""
);
// get form data
$user_data['email'] = isset($posted_data['your-email']) ? trim($posted_data['your-email']) : '';
$user_data['firstname'] = isset($posted_data['your-name']) ? trim($posted_data['your-name']) : '';
if (isset($posted_data['your-first-name']) && !empty($posted_data['your-first-name'])) {
$user_data['firstname'] = trim($posted_data['your-first-name']);
}
if (isset($posted_data['your-last-name']) && !empty($posted_data['your-last-name'])) {
$user_data['lastname'] = trim($posted_data['your-last-name']);
}
It looks like it only supports three fields, first name, last name and email.
If [your-name] is used in the form, then it takes that and uses that as the first name in MailPoet and last name is left blank.
If [your-first-name] is used, it takes that for the first name in MailPoet.
If [your-last-name] is used, it takes that for the last name in MailPoet.
Lastly, if [your-email] is used, it takes that for the email address in MailPoet.
I know that doesn’t completely solve your issue, but hopefully it helps you get at least the names into MailPoet.