Merge pull request #1708 from mailpoet/automatic-email-factory

Add automatic email type to newsletters factory [MQ-170]
This commit is contained in:
Rostislav Wolný
2019-01-02 12:45:01 +01:00
committed by GitHub

View File

@@ -99,6 +99,20 @@ class Newsletter {
return $this; return $this;
} }
/**
* @return Newsletter
*/
public function withWcAutomaticType($event = 'woocommerce_first_purchase') {
$this->data['type'] = 'automatic';
$this->withOptions([
14 => 'woocommerce', // group
15 => $event,
16 => 'user', // sendTo
19 => 'immediate', // afterTimeType
]);
return $this;
}
/** /**
* @param array $options * @param array $options
* *