From 372c44839169b02b0778131ab8e273d922a53a55 Mon Sep 17 00:00:00 2001 From: Omar Sahyoun Date: Wed, 10 May 2017 17:04:21 +0100 Subject: [PATCH] Pass ref vals to action --- app/frontend/containers/EmailTargetView/EmailTargetView.js | 4 +++- app/views/plugins/email_targets/_email_target.liquid | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/frontend/containers/EmailTargetView/EmailTargetView.js b/app/frontend/containers/EmailTargetView/EmailTargetView.js index b11659f70..33847deb1 100644 --- a/app/frontend/containers/EmailTargetView/EmailTargetView.js +++ b/app/frontend/containers/EmailTargetView/EmailTargetView.js @@ -189,8 +189,9 @@ class EmailTargetView extends Component { to_email: this.props.fundEmail, }; - this.props.changeSubmitting(true); + _.merge(payload, this.props.formValues); + this.props.changeSubmitting(true); $.post('/api/email_targets', payload).done((a, b, c) => {}); }; @@ -394,6 +395,7 @@ export const mapStateToProps = (state: OwnState) => ({ to: state.emailTarget.to, page: state.emailTarget.page, isSubmitting: state.emailTarget.isSubmitting, + formValues: state.emailTarget.formValues }); export const mapDispatchToProps = (dispatch: Dispatch<*>) => ({ diff --git a/app/views/plugins/email_targets/_email_target.liquid b/app/views/plugins/email_targets/_email_target.liquid index 724cb14ea..27d401324 100644 --- a/app/views/plugins/email_targets/_email_target.liquid +++ b/app/views/plugins/email_targets/_email_target.liquid @@ -5,11 +5,11 @@ $(document).ready(function() { var member = window.champaign.personalization.member; var data = _.clone(window.champaign.personalization.emailTarget['{{ref}}']); - _.merge(data, { name: member.full_name, email: member.email, country: member.country, + formValues: window.champaign.personalization.formValues }); mountEmailTarget('email-target-component', data);