Fix subscriber status resetting on WP user creation

Fixes:#2960
[MAILPOET-3016]
This commit is contained in:
Lysy Jan
2020-08-03 11:15:19 +02:00
committed by Veljko V
parent 762d205438
commit ba4fd9eb1b
2 changed files with 18 additions and 0 deletions

View File

@ -43,6 +43,11 @@ class WP {
$wpSegment = Segment::getWPSegment();
if (!$wpSegment) return;
// find subscriber by email when is false
if (!$subscriber) {
$subscriber = Subscriber::where('email', $wpUser->user_email)->findOne(); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.NotCamelCaps
}
$scheduleWelcomeNewsletter = false;
if (in_array($currentFilter, ['profile_update', 'user_register'])) {
$scheduleWelcomeNewsletter = true;