rev.10 Add new option

Option to configure the maximum number of recipients for one email (possibly for subscriptions).
This commit is contained in:
Visman 2020-08-30 22:09:37 +07:00
parent 0fefe8a715
commit 9c9558328c
6 changed files with 36 additions and 2 deletions

View file

@ -1107,6 +1107,7 @@ class Install extends Admin
'o_webmaster_email' => $v->email,
'o_forum_subscriptions' => 1,
'o_topic_subscriptions' => 1,
'i_email_max_recipients' => 1,
'o_smtp_host' => NULL,
'o_smtp_user' => NULL,
'o_smtp_pass' => NULL,

View file

@ -73,6 +73,7 @@ class Options extends Admin
'o_webmaster_email' => 'required|string:trim|email',
'o_forum_subscriptions' => 'required|integer|in:0,1',
'o_topic_subscriptions' => 'required|integer|in:0,1',
'i_email_max_recipients' => 'required|integer|min:1|max:99999',
'o_smtp_host' => 'string:trim|max:255',
'o_smtp_user' => 'string:trim|max:255',
'o_smtp_pass' => 'string:trim|max:255', //??????
@ -597,6 +598,14 @@ class Options extends Admin
'caption' => __('Topic subscriptions label'),
'info' => __('Topic subscriptions help'),
],
'i_email_max_recipients' => [
'type' => 'number',
'min' => 1,
'max' => 99999,
'value' => $config->i_email_max_recipients,
'caption' => __('Email max recipients label'),
'info' => __('Email max recipients help'),
],
'o_smtp_host' => [
'type' => 'text',
'maxlength' => 255,

View file

@ -17,7 +17,7 @@ class Update extends Admin
{
const PHP_MIN = '7.3.0';
const LATEST_REV_WITH_DB_CHANGES = 8;
const LATEST_REV_WITH_DB_CHANGES = 9;
const LOCK_NAME = 'lock_update';
const LOCk_TTL = 1800;
@ -588,4 +588,16 @@ class Update extends Admin
return null;
}
/**
* rev.9 to rev.10
*/
protected function stageNumber9(array $args): ?int
{
$this->c->config->i_email_max_recipients = 1;
$this->c->config->save();
return null;
}
}

View file

@ -42,7 +42,7 @@ if (
}
$c->PUBLIC_URL = $c->BASE_URL . $forkPublicPrefix;
$c->FORK_REVISION = 9;
$c->FORK_REVISION = 10;
$c->START = $forkStart;
$c->DIR_APP = __DIR__;
$c->DIR_PUBLIC = $forkPublic;

View file

@ -404,3 +404,9 @@ msgstr "Announcement message (HTML)"
msgid "Announcement message help"
msgstr ""
msgid "Email max recipients label"
msgstr "Max recipients"
msgid "Email max recipients help"
msgstr "The maximum number of recipients for one email. Depends on your mail server."

View file

@ -404,3 +404,9 @@ msgstr "Текст объявления (HTML)"
msgid "Announcement message help"
msgstr ""
msgid "Email max recipients label"
msgstr "Макс. получателей"
msgid "Email max recipients help"
msgstr "Максимальное количество получателей в одном письме. Зависит от вашего почтового сервера."