as on my tests last night, after someone passed me the answer from mailpoet:
Good news and bad news! The good news is I believe I've found the root cause. The bad news is. Another user has the same issue (MemberPress as well) and it looks like it has to be fixed in their integration.
It looks like it's an issue with their integration, they are missing the send_confirmation_email and send_welcome_email parts from
https://kb.mailpoet.com/article/195-add ... Subscriber
While that shouldn't be needed as they default to true, it appears because MemberPress modifies the signup flow that they actually return false, so it looks like this needs to be fixed on MemberPress's side.
this can be true, may the process on memberpress do non fire correctly the
WP user_register filter/hook, i've still not test this part of the memberpress mailpoet addon, so may also the above is completely correct from mailpoet and it would be a bug in memberpress about this.
But i was aiming to welcome email not working, that not require to add users to mailpoet lists, but only to pass the correct WP user ID to the mailpoet
synchronizeUser method, and it is done correctly on memberpress where:
Code: Select all
\MailPoet\Segments\WP::synchronizeUser($usr->ID);
what in the other side happen when this is executed, is that on file
/wp-content/plugins/mailpoet/lib/Segments/WP.php
where code:
Code: Select all
break;
case 'profile_update':
case 'user_register':
$schedule_welcome_newsletter = true;
case 'added_existing_user':
default:
the case not fire, because the user_register action/filter already executed.
To resolve, change the above with this:
Code: Select all
break;
case 'profile_update':
case 'user_register':
case 'mepr-signup':
$schedule_welcome_newsletter = true;
case 'added_existing_user':
default:
may mailpoet is totally right about the fact in memberpress something execute earlier and in a not common way that lead mailpoet to not fire/recognize the user_register action: but i need a fast fix and this work in just a line.
p.s
in case same page process some payment or user data confirmation, may the code could be these 3 lines instead,
to avoid to re-send out welcome emails to users, in case (for example), of payment renew processed within same registration page:
Code: Select all
break;
case 'profile_update':
case 'user_register':
case 'mepr-signup':
$schedule_welcome_newsletter = true;
if( current_filter() == 'mepr-signup' && isset($_REQUEST['logged_in_purchase']) OR current_filter() == 'mepr-signup' && isset($_REQUEST['mepr_process_payment_form']) ){
$schedule_welcome_newsletter = false;
}
case 'added_existing_user':
default: