@@ -469,14 +469,16 @@ function catchy(f) {
469
469
}
470
470
471
471
if ( data . auto ) {
472
- if ( ! data . autoCohorts || ! data . autoCohorts . length ) {
473
- return [ { error : 'Cohorts are required for auto messages' } ] ;
474
- }
475
- if ( ! cohorts || data . autoCohorts . length != cohorts . length ) {
476
- return [ { error : 'Cohort not found' } ] ;
477
- }
478
- if ( data . autoOnEntry !== false && data . autoOnEntry !== true ) {
479
- return [ { error : 'autoOnEntry is required for auto messages' } ] ;
472
+ if ( ! skipMpl ) {
473
+ if ( ! data . autoCohorts || ! data . autoCohorts . length ) {
474
+ return [ { error : 'Cohorts are required for auto messages' } ] ;
475
+ }
476
+ if ( ! cohorts || data . autoCohorts . length != cohorts . length ) {
477
+ return [ { error : 'Cohort not found' } ] ;
478
+ }
479
+ if ( data . autoOnEntry !== false && data . autoOnEntry !== true ) {
480
+ return [ { error : 'autoOnEntry is required for auto messages' } ] ;
481
+ }
480
482
}
481
483
} else if ( data . tx ) {
482
484
@@ -540,7 +542,7 @@ function catchy(f) {
540
542
tx : data . tx || false ,
541
543
auto : data . auto || false ,
542
544
autoOnEntry : data . auto ? data . autoOnEntry : undefined ,
543
- autoCohorts : data . auto ? cohorts . map ( c => c . _id ) : undefined ,
545
+ autoCohorts : data . auto && cohorts ? cohorts . map ( c => c . _id ) : undefined ,
544
546
autoEnd : data . auto ? data . autoEnd : undefined ,
545
547
autoDelay : data . auto ? data . autoDelay : undefined ,
546
548
autoTime : data . auto ? data . autoTime : undefined ,
0 commit comments