Support for detecting MTA by its response. Message IDs are reconstructed based on detected MTA.
Bugfixes for AWS. AWS now seems to work.
This commit is contained in:
Tomas Bures 2019-05-20 00:21:03 +02:00
parent bbbe671d59
commit 3c72e778d9
6 changed files with 83 additions and 45 deletions

View file

@ -93,6 +93,14 @@ export default class CUD extends Component {
}
submitFormValuesMutator(data) {
data.seconds = Number.parseInt(data.daysAfter) * 3600 * 24;
if (data.entity === Entity.SUBSCRIPTION) {
data.event = data.subscriptionEvent;
} else if (data.entity === Entity.CAMPAIGN) {
data.event = data.campaignEvent;
}
return filterData(data, ['name', 'description', 'entity', 'event', 'seconds', 'enabled', 'source_campaign']);
}
@ -157,22 +165,14 @@ export default class CUD extends Component {
this.disableForm();
this.setFormStatusMessage('info', t('saving'));
const submitResult = await this.validateAndSendFormValuesToURL(sendMethod, url, data => {
data.seconds = Number.parseInt(data.daysAfter) * 3600 * 24;
if (data.entity === Entity.SUBSCRIPTION) {
data.event = data.subscriptionEvent;
} else if (data.entity === Entity.CAMPAIGN) {
data.event = data.campaignEvent;
}
});
const submitResult = await this.validateAndSendFormValuesToURL(sendMethod, url);
if (submitResult) {
if (this.props.entity) {
if (submitAndLeave) {
this.navigateToWithFlashMessage(`/campaigns/${this.props.campaign.id}/triggers`, 'success', t('triggerUpdated'));
} else {
await this.getFormValuesFromURL(`rest/triggers/${this.props.campaign.id}/${this.props.entity.id}`, ::this.getFormValuesMutator);
await this.getFormValuesFromURL(`rest/triggers/${this.props.campaign.id}/${this.props.entity.id}`);
this.enableForm();
this.setFormStatusMessage('success', t('triggerUpdated'));
}

View file

@ -57,18 +57,21 @@ export default class List extends Component {
segmentId: PropTypes.string
}
updateSegmentSelection(props) {
componentDidMount() {
this.populateFormValues({
segment: props.segmentId || ''
segment: this.props.segmentId || ''
});
}
componentDidMount() {
this.updateSegmentSelection(this.props);
}
componentDidUpdate() {
this.updateSegmentSelection(this.props);
const segmentId = this.props.segmentId || '';
if (this.getFormValue('segment') !== segmentId) {
// Populate is used here because it does not invoke onChange
this.populateFormValues({
segment: segmentId
});
}
}
render() {

View file

@ -4,7 +4,16 @@ import React, {Component} from 'react';
import {withTranslation} from '../lib/i18n';
import {Title, withPageHelpers} from '../lib/page'
import {Link} from 'react-router-dom'
import {Button, ButtonRow, Form, FormSendMethod, InputField, withForm, withFormErrorHandlers} from '../lib/form';
import {
Button,
ButtonRow,
filterData,
Form,
FormSendMethod,
InputField,
withForm,
withFormErrorHandlers
} from '../lib/form';
import {withAsyncErrorHandler, withErrorHandling} from '../lib/error-handling';
import passwordValidator from '../../../shared/password-validator';
import axios from '../lib/axios';
@ -39,6 +48,10 @@ export default class Account extends Component {
});
}
submitFormValuesMutator(data) {
return filterData(data, ['password']);
}
@withAsyncErrorHandler
async validateResetToken() {
const params = this.props.match.params;
@ -96,9 +109,7 @@ export default class Account extends Component {
this.disableForm();
this.setFormStatusMessage('info', t('resettingPassword'));
const submitSuccessful = await this.validateAndSendFormValuesToURL(FormSendMethod.POST, 'rest/password-reset', data => {
delete data.password2;
});
const submitSuccessful = await this.validateAndSendFormValuesToURL(FormSendMethod.POST, 'rest/password-reset');
if (submitSuccessful) {
this.navigateToWithFlashMessage('/login', 'success', t('passwordReset-1'));

View file

@ -78,6 +78,12 @@ export default class CUD extends Component {
}
submitFormValuesMutator(data) {
this.mailerTypes[data.mailer_type].beforeSave(data);
if (!data.verpEnabled) {
data.verp_hostname = null;
data.verp_disable_sender_header = false;
}
return filterData(data, ['name', 'description', 'from_email', 'from_email_overridable', 'from_name',
'from_name_overridable', 'reply_to', 'reply_to_overridable', 'subject', 'subject_overridable', 'x_mailer',
'verp_hostname', 'verp_disable_sender_header', 'mailer_type', 'mailer_settings', 'namespace']);
@ -155,13 +161,7 @@ export default class CUD extends Component {
this.disableForm();
this.setFormStatusMessage('info', t('saving'));
const submitResult = await this.validateAndSendFormValuesToURL(sendMethod, url, data => {
this.mailerTypes[data.mailer_type].beforeSave(data);
if (!data.verpEnabled) {
data.verp_hostname = null;
data.verp_disable_sender_header = false;
}
});
const submitResult = await this.validateAndSendFormValuesToURL(sendMethod, url);
if (submitResult) {
if (this.props.entity) {