Manage subscriptions

- make use of the SubscriberSegment::status column to keep track of unsubscriptions
- unsubscribed segments now appear grayed out in the Subscribers listing
- added unsubscribed_at after segment names when editing a subscriber
- added date() method for Twig (uses WP's date format / date_offset)
- fixed typo in Form iframe export
- fixed unit test for Newsletters
- updated selection component (JSX) to allow more customization
This commit is contained in:
Jonathan Labreuille
2016-02-22 11:35:34 +01:00
parent acf300160d
commit 07d533a810
19 changed files with 313 additions and 138 deletions

View File

@@ -52,6 +52,11 @@ class Newsletter extends Model {
);
}
function withSegments() {
$this->segments = $this->segments()->findArray();
return $this;
}
function options() {
return $this->has_many_through(
__NAMESPACE__.'\NewsletterOptionField',
@@ -67,6 +72,12 @@ class Newsletter extends Model {
->findOne();
}
function withSendingQueue() {
$this->queue = $this->getQueue();
return $this;
}
static function search($orm, $search = '') {
return $orm->where_like('subject', '%' . $search . '%');
}