Prevent activating email without body
[MAILPOET-2366]
This commit is contained in:
committed by
Jack Kitterhing
parent
e56a654b2b
commit
35c9973c85
@@ -344,6 +344,17 @@ class Newsletter extends Model {
|
||||
}
|
||||
|
||||
function setStatus($status = null) {
|
||||
if ($status === self::STATUS_ACTIVE) {
|
||||
if (!$this->body || empty(json_decode($this->body))) {
|
||||
$this->setError(
|
||||
Helpers::replaceLinkTags(
|
||||
__('This is an empty email without any content and it cannot be sent. Please update [link]the email[/link].'),
|
||||
'admin.php?page=mailpoet-newsletter-editor&id=' . $this->id
|
||||
)
|
||||
);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
if (in_array($status, [
|
||||
self::STATUS_DRAFT,
|
||||
self::STATUS_SCHEDULED,
|
||||
|
Reference in New Issue
Block a user