Create new forms with the right message [MAILPOET-1636]
This commit is contained in:
committed by
M. Shull
parent
444e6e937c
commit
64e1a1e16c
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace MailPoet\Models;
|
||||
|
||||
use MailPoet\Settings\SettingsController;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
@@ -14,6 +15,9 @@ if (!defined('ABSPATH')) exit;
|
||||
class Form extends Model {
|
||||
public static $_table = MP_FORMS_TABLE;
|
||||
|
||||
const MESSAGE_WHEN_CONFIRMATION_ENABLED = 'Check your inbox or spam folder to confirm your subscription.';
|
||||
const MESSAGE_WHEN_CONFIRMATION_DISABLED = "You've been successfully subscribed to our newsletter!";
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
@@ -120,4 +124,12 @@ class Form extends Model {
|
||||
return $orm->whereNull('deleted_at');
|
||||
}
|
||||
|
||||
static function getDefaultSuccessMessage() {
|
||||
$settings = new SettingsController;
|
||||
if ($settings->get('signup_confirmation.enabled')) {
|
||||
return WPFunctions::get()->__(self::MESSAGE_WHEN_CONFIRMATION_ENABLED, 'mailpoet');
|
||||
}
|
||||
return WPFunctions::get()->__(self::MESSAGE_WHEN_CONFIRMATION_DISABLED, 'mailpoet');
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user