diff --git a/code/model/UserDefinedForm.php b/code/model/UserDefinedForm.php index 6b1d269..25724a1 100755 --- a/code/model/UserDefinedForm.php +++ b/code/model/UserDefinedForm.php @@ -59,6 +59,18 @@ class UserDefinedForm extends Page { "EmailRecipients" => "UserDefinedForm_EmailRecipient" ); + /** + * @var Boolean + */ + private static $recipients_warning_enabled = false; + + /** + * @return Boolean + */ + public static function set_recipients_warning_enabled($bool = true) { + self::$recipients_warning_enabled = $bool; + } + /** * Temporary storage of field ids when the form is duplicated. * Example layout: array('EditableCheckbox3' => 'EditableCheckbox14') @@ -182,7 +194,7 @@ SQL; $fields = parent::getCMSFields(); - if($this->EmailRecipients()->Count() == 0) { + if($this->EmailRecipients()->Count() == 0 && UserDefinedForm::config()->recipients_warning_enabled) { $fields->addFieldToTab("Root.Main", new LiteralField("EmailRecipientsWarning", "

" . _t("UserDefinedForm.NORECIPIENTS", "Warning: You have not configured any recipients. Form submissions may be missed.")