diff --git a/assets/js/src/welcome_wizard/steps/sender_step.jsx b/assets/js/src/welcome_wizard/steps/sender_step.jsx index 46a4df676a..f86ff64c6d 100644 --- a/assets/js/src/welcome_wizard/steps/sender_step.jsx +++ b/assets/js/src/welcome_wizard/steps/sender_step.jsx @@ -43,6 +43,18 @@ const WelcomeWizardSenderStep = props => ( onChange={e => props.update_sender({ address: e.target.value })} /> + {MailPoet.I18n.t('noThanksSkip')} @@ -55,14 +67,19 @@ WelcomeWizardSenderStep.propTypes = { loading: PropTypes.bool.isRequired, update_sender: PropTypes.func.isRequired, submit_sender: PropTypes.func.isRequired, + update_reply_to: PropTypes.func.isRequired, sender: PropTypes.shape({ name: PropTypes.string, address: PropTypes.string, }), + reply_to: PropTypes.shape({ + address: PropTypes.string, + }), }; WelcomeWizardSenderStep.defaultProps = { sender: null, + reply_to: null, }; export default WelcomeWizardSenderStep; diff --git a/assets/js/src/welcome_wizard/steps_controller.jsx b/assets/js/src/welcome_wizard/steps_controller.jsx index 1a809a4418..23d50ef4f6 100644 --- a/assets/js/src/welcome_wizard/steps_controller.jsx +++ b/assets/js/src/welcome_wizard/steps_controller.jsx @@ -17,12 +17,14 @@ class WelcomeWizardStepsController extends React.Component { shouldSetSender: !window.is_mp2_migration_complete, loading: false, sender: window.sender_data, + replyTo: window.reply_to_data, }; this.finishWizard = this.finishWizard.bind(this); this.updateSettings = this.updateSettings.bind(this); this.activateTracking = this.activateTracking.bind(this); this.updateSender = this.updateSender.bind(this); + this.updateReplyTo = this.updateReplyTo.bind(this); this.submitSender = this.submitSender.bind(this); this.showWooCommerceStepOrFinish = this.showWooCommerceStepOrFinish.bind(this); this.componentDidUpdate(); @@ -79,8 +81,17 @@ class WelcomeWizardStepsController extends React.Component { }); } + updateReplyTo(data) { + this.setState({ + replyTo: Object.assign({}, this.state.replyTo, data), + }); + } + submitSender() { - this.updateSettings({ sender: this.state.sender }).then(() => (this.props.history.push('/steps/2'))); + this.updateSettings({ + sender: this.state.sender, + reply_to: this.state.replyTo, + }).then(() => (this.props.history.push('/steps/2'))); } render() { @@ -96,9 +107,11 @@ class WelcomeWizardStepsController extends React.Component { : null } diff --git a/lib/Config/Menu.php b/lib/Config/Menu.php index d4febec313..42aaf8a6ad 100644 --- a/lib/Config/Menu.php +++ b/lib/Config/Menu.php @@ -343,7 +343,8 @@ class Menu { 'is_mp2_migration_complete' => (bool)Setting::getValue('mailpoet_migration_complete'), 'is_woocommerce_active' => class_exists('WooCommerce'), 'finish_wizard_url' => admin_url('admin.php?page=' . self::MAIN_PAGE_SLUG), - 'sender' => Setting::getValue('sender') + 'sender' => Setting::getValue('sender'), + 'reply_to' => Setting::getValue('reply_to'), ]; $this->displayPage('welcome_wizard.html', $data); } diff --git a/views/welcome_wizard.html b/views/welcome_wizard.html index 1c810a74ab..b41ee061e5 100644 --- a/views/welcome_wizard.html +++ b/views/welcome_wizard.html @@ -9,6 +9,7 @@ var is_woocommerce_active = <%= json_encode(is_woocommerce_active) %>; var finish_wizard_url = '<%= finish_wizard_url %>'; var sender_data = <%= json_encode(sender) %>; + var reply_to_data = <%= json_encode(reply_to) %>;
@@ -37,6 +38,7 @@ 'allowAndFinish': _x('Allow & Finish', 'A label on a button'), 'allowAndContinue': _x('Allow & Continue', 'A label on a button'), 'senderAddress': _x('From Address', 'A form field label'), +'replyToAddress': _x('Reply-to Address', 'A form field label'), 'senderName': _x('From Name', 'A form field label'), 'next': _x('Next', 'A label on a button'), 'gotIt': _x('Got it!', 'A label on a button'),