Don't send signup confirmation when signup confirmation is disabled
Fixed issue with select2 not selecting values by default on newsletter send step
This commit is contained in:
@ -89,10 +89,17 @@ function(
|
|||||||
if(this.props.field['selected'] !== undefined) {
|
if(this.props.field['selected'] !== undefined) {
|
||||||
return this.props.field['selected'](this.props.item);
|
return this.props.field['selected'](this.props.item);
|
||||||
} else if(this.props.item !== undefined && this.props.field.name !== undefined) {
|
} else if(this.props.item !== undefined && this.props.field.name !== undefined) {
|
||||||
return this.props.item[this.props.field.name];
|
if (this.allowMultipleValues()) {
|
||||||
} else {
|
if (Array.isArray(this.props.item[this.props.field.name])) {
|
||||||
return null;
|
return this.props.item[this.props.field.name].map(function(item) {
|
||||||
|
return item.id;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return this.props.item[this.props.field.name];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
},
|
},
|
||||||
loadCachedItems: function() {
|
loadCachedItems: function() {
|
||||||
if(typeof(window['mailpoet_'+this.props.field.endpoint]) !== 'undefined') {
|
if(typeof(window['mailpoet_'+this.props.field.endpoint]) !== 'undefined') {
|
||||||
|
@ -75,6 +75,10 @@ class Subscriber extends Model {
|
|||||||
function sendConfirmationEmail() {
|
function sendConfirmationEmail() {
|
||||||
$signup_confirmation = Setting::getValue('signup_confirmation');
|
$signup_confirmation = Setting::getValue('signup_confirmation');
|
||||||
|
|
||||||
|
if((bool)$signup_confirmation['enabled'] === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$segments = $this->segments()->findMany();
|
$segments = $this->segments()->findMany();
|
||||||
$segment_names = array_map(function($segment) {
|
$segment_names = array_map(function($segment) {
|
||||||
return $segment->name;
|
return $segment->name;
|
||||||
|
Reference in New Issue
Block a user