// 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); this.state = Object.assign(this.state, { sendEmailNotifications: props.config.EmailSettings.SendEmailNotifications, feedbackName: props.config.EmailSettings.FeedbackName, feedbackEmail: props.config.EmailSettings.FeedbackEmail, smtpUsername: props.config.EmailSettings.SMTPUsername, smtpPassword: props.config.EmailSettings.SMTPPassword, smtpServer: props.config.EmailSettings.SMTPServer, smtpPort: props.config.EmailSettings.SMTPPort, connectionSecurity: props.config.EmailSettings.ConnectionSecurity, enableSecurityFixAlert: props.config.ServiceSettings.EnableSecurityFixAlert }); } getConfigFromState(config) { config.EmailSettings.SendEmailNotifications = this.state.sendEmailNotifications; config.EmailSettings.FeedbackName = this.state.feedbackName; config.EmailSettings.FeedbackEmail = this.state.feedbackEmail; 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; } renderTitle() { return (