From 5ea025022cdcdbeb642d28cdd96d4c61fb7b6fce Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Mon, 13 Apr 2020 06:53:21 +0200 Subject: [PATCH] Add PHPMail fields [MAILPOET-2693] --- assets/css/src/settings.scss | 4 + .../send_with/other/other_sending_methods.tsx | 5 +- .../pages/send_with/other/php_mail_fields.tsx | 135 ++++++++++++++++++ .../send_with/other/sending_frequency.tsx | 114 +++++++++++++++ views/settings.html | 7 + 5 files changed, 264 insertions(+), 1 deletion(-) create mode 100644 assets/js/src/settings/pages/send_with/other/php_mail_fields.tsx create mode 100644 assets/js/src/settings/pages/send_with/other/sending_frequency.tsx diff --git a/assets/css/src/settings.scss b/assets/css/src/settings.scss index 151561f43e..b977a7a884 100644 --- a/assets/css/src/settings.scss +++ b/assets/css/src/settings.scss @@ -43,6 +43,10 @@ margin: 0px 3px; font-weight: bold; } + + .mailpoet_emails_per_second_warning { + color: #d54e21; + } } .mailpoet_woocommerce_editor_button { diff --git a/assets/js/src/settings/pages/send_with/other/other_sending_methods.tsx b/assets/js/src/settings/pages/send_with/other/other_sending_methods.tsx index 6bc0439166..0d71996688 100644 --- a/assets/js/src/settings/pages/send_with/other/other_sending_methods.tsx +++ b/assets/js/src/settings/pages/send_with/other/other_sending_methods.tsx @@ -1,14 +1,17 @@ import React from 'react'; +import { useSetting } from 'settings/store/hooks'; import SendingMethod from './sending_method'; import SPF from './spf'; import TestSending from './test_sending'; import ActivateOrCancel from './activate_or_cancel'; +import PHPMailFields from './php_mail_fields'; export default function OtherSendingMethods() { + const [method] = useSetting('mta', 'method'); return (
- + {method === 'PHPMail' && } diff --git a/assets/js/src/settings/pages/send_with/other/php_mail_fields.tsx b/assets/js/src/settings/pages/send_with/other/php_mail_fields.tsx new file mode 100644 index 0000000000..548390e3a2 --- /dev/null +++ b/assets/js/src/settings/pages/send_with/other/php_mail_fields.tsx @@ -0,0 +1,135 @@ +import React from 'react'; +import { Label, Inputs } from 'settings/components'; +import { t, onChange } from 'common/functions'; +import { useSetting } from 'settings/store/hooks'; +import SendingFrequency from './sending_frequency'; + +export default function PHPMailFields() { + const [hostName, setHostName] = useSetting('web_host'); + const host = hosts[hostName]; + return ( + <> +