- Extends save() method to convert emails to lowercase format

This commit is contained in:
Vlad
2016-11-22 12:13:13 -05:00
parent 7bf9e8b06e
commit 6f49201393

View File

@ -44,6 +44,12 @@ class Subscriber extends Model {
->where(MP_SUBSCRIBER_SEGMENT_TABLE.'.status', self::STATUS_SUBSCRIBED);
}
function save() {
// convert email to lowercase format
$this->email = strtolower($this->email);
return parent::save();
}
function delete() {
// WP Users cannot be deleted
if($this->isWPUser()) {