Revert "v2.39.0 (#2180)"

This reverts commit 1e228c86c3.
This commit is contained in:
Raktima
2026-05-25 17:24:36 +05:30
committed by GitHub
parent 1e228c86c3
commit 7b4d0bf052
92 changed files with 5372 additions and 8680 deletions
@@ -3,7 +3,6 @@ import { cloudServerUrl, mailTemplate, replaceMailVaribles, serverAppId } from '
import { setDocumentCount } from '../../utils/CountUtils.js';
import crypto from 'crypto';
import sendSystemMail from './sendSystemMail.js';
function chunkArray(arr, size) {
const out = [];
@@ -51,6 +50,9 @@ async function sendOwnerSummaryEmail({
failedList,
}) {
try {
const url = `${serverUrl}/functions/sendmailv3`;
const headers = { 'Content-Type': 'application/json', 'X-Parse-Application-Id': appId };
const subject = `Bulk send finished: ${failed} of ${total} failed to create`;
const failureHtml = failedList?.length
@@ -81,7 +83,7 @@ async function sendOwnerSummaryEmail({
html,
};
await sendSystemMail({ params });
await axios.post(url, params, { headers });
} catch (e) {
console.log('batchdoc Failed to send owner summary email:', e?.message || e);
}
@@ -90,7 +92,7 @@ async function sendOwnerSummaryEmail({
async function deductcount(docsCount, extUserId) {
try {
if (extUserId) {
setDocumentCount(extUserId, docsCount);
setDocumentCount(extUserId);
}
} catch (err) {
console.log('batchdoc deductcount error: ', err);
@@ -228,7 +230,6 @@ async function startBulkSendInBackground(userId, Documents, Ip, parseConfig, typ
Description: x.Description,
CreatedBy: x.CreatedBy,
SendinOrder: x.SendinOrder || true,
SendInOrderStrict: x.SendInOrderStrict || false,
ExtUserPtr: {
__type: 'Pointer',
className: x.ExtUserPtr.className,
@@ -271,7 +272,6 @@ async function startBulkSendInBackground(userId, Documents, Ip, parseConfig, typ
...(x?.SignatureType ? { SignatureType: x?.SignatureType } : {}),
...(x?.NotifyOnSignatures ? { NotifyOnSignatures: x?.NotifyOnSignatures } : {}),
...(x?.Bcc?.length > 0 ? { Bcc: x?.Bcc } : {}),
...(x?.Cc?.length > 0 ? { Cc: x?.Cc } : {}),
...(x?.RedirectUrl ? { RedirectUrl: x?.RedirectUrl } : {}),
...(mailBody ? { RequestBody: mailBody } : {}),
...(mailSubject ? { RequestSubject: mailSubject } : {}),
@@ -303,6 +303,7 @@ async function startBulkSendInBackground(userId, Documents, Ip, parseConfig, typ
createdAt: response.data[0]?.success?.createdAt,
};
deductcount(response.data.length, resExt.id);
console.log('here');
sendMail(updateDocuments, publicUrl); //sessionToken
return { total: 1, created: 1, failed: 0 };
}