Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Pass ref vals to action
Browse files Browse the repository at this point in the history
  • Loading branch information
osahyoun committed May 10, 2017
1 parent 386fab2 commit 372c448
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/frontend/containers/EmailTargetView/EmailTargetView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {});
};

Expand Down Expand Up @@ -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<*>) => ({
Expand Down
2 changes: 1 addition & 1 deletion app/views/plugins/email_targets/_email_target.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 372c448

Please sign in to comment.