feat: Add ability to configure and test SMTP via UI

This commit is contained in:
Maksim Eltyshev
2025-09-22 20:35:13 +02:00
parent 3a12bb7457
commit c6f4dcdb70
114 changed files with 2161 additions and 301 deletions
+49
View File
@@ -0,0 +1,49 @@
/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
import { call, put } from 'redux-saga/effects';
import request from '../request';
import actions from '../../../actions';
import api from '../../../api';
export function* updateConfig(data) {
yield put(actions.updateConfig(data));
let config;
try {
({ item: config } = yield call(request, api.updateConfig, data));
} catch (error) {
yield put(actions.updateConfig.failure(error));
return;
}
yield put(actions.updateConfig.success(config));
}
export function* handleConfigUpdate(config) {
yield put(actions.handleConfigUpdate(config));
}
export function* testSmtpConfig() {
yield put(actions.testSmtpConfig());
let logs;
try {
({
included: { logs },
} = yield call(request, api.testSmtpConfig));
} catch (error) {
yield put(actions.testSmtpConfig.failure(error));
}
yield put(actions.testSmtpConfig.success(logs));
}
export default {
updateConfig,
handleConfigUpdate,
testSmtpConfig,
};