Merge pull request #2576 from nxglabs/sync-to-public_repo-27677371306

Merge pull request #2575 from nxglabs/staging
This commit is contained in:
raktima-opensignlabs
2026-06-17 09:08:15 +00:00
parent 6271fedcbf
commit be0c4a2cbf
25 changed files with 1079 additions and 671 deletions
@@ -116,13 +116,24 @@ async function sendMail(document, publicUrl) {
: senderEmail;
if (document.SendinOrder) {
signerMail = signerMail.slice();
signerMail.splice(1);
const getRole = signer => signer?.SignerRole || signer?.signer_role || signer?.role || 'signer';
const firstSignerIndex = signerMail.findIndex(signer => getRole(signer) === 'signer');
signerMail = signerMail.filter((signer, idx) => {
const role = getRole(signer);
return role === 'viewer' || idx === firstSignerIndex;
});
if (signerMail.length === 0 && document?.Placeholders?.length > 0) {
signerMail = document.Placeholders.filter(x => x?.Role !== 'prefill').slice(0, 1);
}
}
for (let i = 0; i < signerMail.length; i++) {
try {
let url = `${serverUrl}/functions/sendmailv3`;
const headers = { 'Content-Type': 'application/json', 'X-Parse-Application-Id': appId };
const headers = {
'Content-Type': 'application/json',
'X-Parse-Application-Id': appId,
};
const objectId = signerMail[i]?.signerObjId;
const hostUrl = baseUrl.origin;
let encodeBase64;