// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import React from 'react'; import * as Utils from 'utils/utils.jsx'; import AdminSettings from './admin_settings.jsx'; import BooleanSetting from './boolean_setting.jsx'; import ConnectionSecurityDropdownSetting from './connection_security_dropdown_setting.jsx'; import EmailConnectionTest from './email_connection_test.jsx'; import {FormattedHTMLMessage, FormattedMessage} from 'react-intl'; import SettingsGroup from './settings_group.jsx'; import TextSetting from './text_setting.jsx'; export default class EmailSettings extends AdminSettings { constructor(props) { super(props); this.getConfigFromState = this.getConfigFromState.bind(this); this.renderSettings = this.renderSettings.bind(this); } getConfigFromState(config) { config.EmailSettings.SendEmailNotifications = this.state.sendEmailNotifications; config.EmailSettings.FeedbackName = this.state.feedbackName; config.EmailSettings.FeedbackEmail = this.state.feedbackEmail; config.EmailSettings.FeedbackOrganization = this.state.feedbackOrganization; config.EmailSettings.SMTPUsername = this.state.smtpUsername; config.EmailSettings.SMTPPassword = this.state.smtpPassword; config.EmailSettings.SMTPServer = this.state.smtpServer; config.EmailSettings.SMTPPort = this.state.smtpPort; config.EmailSettings.ConnectionSecurity = this.state.connectionSecurity; config.ServiceSettings.EnableSecurityFixAlert = this.state.enableSecurityFixAlert; return config; } getStateFromConfig(config) { return { sendEmailNotifications: config.EmailSettings.SendEmailNotifications, feedbackName: config.EmailSettings.FeedbackName, feedbackEmail: config.EmailSettings.FeedbackEmail, feedbackOrganization: config.EmailSettings.FeedbackOrganization, smtpUsername: config.EmailSettings.SMTPUsername, smtpPassword: config.EmailSettings.SMTPPassword, smtpServer: config.EmailSettings.SMTPServer, smtpPort: config.EmailSettings.SMTPPort, connectionSecurity: config.EmailSettings.ConnectionSecurity, enableSecurityFixAlert: config.ServiceSettings.EnableSecurityFixAlert }; } renderTitle() { return (