mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-17 21:25:54 +02:00
Merge branch 'staging' of https://github.com/OpenSignLabs/OpenSign into raktima-patch-2
This commit is contained in:
@@ -633,9 +633,9 @@
|
|||||||
"decline-by":"Declined/revoked by",
|
"decline-by":"Declined/revoked by",
|
||||||
"document-declined": "Document declined",
|
"document-declined": "Document declined",
|
||||||
"Add-Webhook":"Add Webhook",
|
"Add-Webhook":"Add Webhook",
|
||||||
"quotamailselfsign": "You've reached your limit of 20 emails for this month. Upgrade now to continue sending emails directly.",
|
"quotamailinfo": "You can send upto 15 signature request emails every month. Upgrade now to send unlimited signing requests directly.",
|
||||||
"quotamail": "You've reached your limit of 20 signature request emails for this month. Upgrade now to continue sending emails directly.",
|
"quotamail": "You've reached your limit of 15 signature request emails for this month. Upgrade now to continue sending emails directly.",
|
||||||
"quotamailTip":"Tip: You can still sign unlimited documents by manually sharing the signing request links below.",
|
"quotamailTip":"Tip: You can still sign unlimited documents by manually sharing the signing request links.",
|
||||||
"quotamailhead":"Quota Reached",
|
"quotamailhead":"Quota Reached",
|
||||||
"public-template-mssg-1":"To integrate OpenSign into your React or Next.js project, simply run the following command:",
|
"public-template-mssg-1":"To integrate OpenSign into your React or Next.js project, simply run the following command:",
|
||||||
"public-template-mssg-2" :"Ensure you have npm or yarn set up in your project. If you’re using Yarn, you can replace npm install with yarn add opensign-react.",
|
"public-template-mssg-2" :"Ensure you have npm or yarn set up in your project. If you’re using Yarn, you can replace npm install with yarn add opensign-react.",
|
||||||
|
|||||||
@@ -633,9 +633,9 @@
|
|||||||
"decline-by" :"Refusé/révoqué par",
|
"decline-by" :"Refusé/révoqué par",
|
||||||
"document-declined":"document refusé",
|
"document-declined":"document refusé",
|
||||||
"Add-Webhook":"Ajouter Webhook",
|
"Add-Webhook":"Ajouter Webhook",
|
||||||
"quotamailselfsign": "Vous avez atteint votre limite de 20 e-mails pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.",
|
"quotamailinfo": "Vous pouvez envoyer jusqu'à 15 e-mails de demande de signature chaque mois. Mettez à niveau maintenant pour envoyer directement des demandes de signature illimitées.",
|
||||||
"quotamail": "Vous avez atteint votre limite de 20 e-mails de demande de signature pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.",
|
"quotamail": "Vous avez atteint votre limite de 15 e-mails de demande de signature pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.",
|
||||||
"quotamailTip":"Astuce : Vous pouvez toujours signer un nombre illimité de documents en partageant manuellement les liens de demande de signature ci-dessous.",
|
"quotamailTip":"Astuce : Vous pouvez toujours signer un nombre illimité de documents en partageant manuellement les liens de demande de signature.",
|
||||||
"quotamailhead":"Quota atteint",
|
"quotamailhead":"Quota atteint",
|
||||||
"public-template-mssg-1" :"Pour intégrer OpenSign dans votre projet React ou Next.js, exécutez simplement la commande suivante :",
|
"public-template-mssg-1" :"Pour intégrer OpenSign dans votre projet React ou Next.js, exécutez simplement la commande suivante :",
|
||||||
"public-template-mssg-2" :"Assurez-vous que npm ou Yarn est configuré dans votre projet. Si vous utilisez Yarn, vous pouvez remplacer npm install par Yarn Add opensign-react.",
|
"public-template-mssg-2" :"Assurez-vous que npm ou Yarn est configuré dans votre projet. Si vous utilisez Yarn, vous pouvez remplacer npm install par Yarn Add opensign-react.",
|
||||||
|
|||||||
@@ -77,7 +77,9 @@ const BulkSendUi = (props) => {
|
|||||||
const addoncredits = resCredits?.addoncredits || 0;
|
const addoncredits = resCredits?.addoncredits || 0;
|
||||||
const totalcredits = allowedcredits + addoncredits;
|
const totalcredits = allowedcredits + addoncredits;
|
||||||
if (totalcredits > 0) {
|
if (totalcredits > 0) {
|
||||||
setIsBulkAvailable(true);
|
if (subscription?.plan !== "freeplan") {
|
||||||
|
setIsBulkAvailable(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setAmount((obj) => ({ ...obj, totalcredits: totalcredits }));
|
setAmount((obj) => ({ ...obj, totalcredits: totalcredits }));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import {
|
|||||||
import { isEnableSubscription, isStaging } from "../constant/const";
|
import { isEnableSubscription, isStaging } from "../constant/const";
|
||||||
import { validplan } from "../json/plansArr";
|
import { validplan } from "../json/plansArr";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import ModalUi from "../primitives/ModalUi";
|
||||||
|
import QuotaCard from "../primitives/QuotaCard";
|
||||||
|
|
||||||
const Header = ({ showSidebar }) => {
|
const Header = ({ showSidebar }) => {
|
||||||
const { t, i18n } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
@@ -27,6 +29,7 @@ const Header = ({ showSidebar }) => {
|
|||||||
localStorage.getItem("appLogo") || " "
|
localStorage.getItem("appLogo") || " "
|
||||||
);
|
);
|
||||||
const [emailUsed, setEmailUsed] = useState(0);
|
const [emailUsed, setEmailUsed] = useState(0);
|
||||||
|
const [isModal, setIsModal] = useState(false);
|
||||||
|
|
||||||
const toggleDropdown = () => {
|
const toggleDropdown = () => {
|
||||||
setIsOpen(!isOpen);
|
setIsOpen(!isOpen);
|
||||||
@@ -111,6 +114,9 @@ const Header = ({ showSidebar }) => {
|
|||||||
const handleNavigation = () => {
|
const handleNavigation = () => {
|
||||||
navigate("/subscription");
|
navigate("/subscription");
|
||||||
};
|
};
|
||||||
|
const handleMailUsed = () => {
|
||||||
|
setIsModal(!isModal);
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{isEnableSubscription && (
|
{isEnableSubscription && (
|
||||||
@@ -203,14 +209,6 @@ const Header = ({ showSidebar }) => {
|
|||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
className="mt-3 z-[1] p-2 shadow op-menu op-menu-sm op-dropdown-content text-base-content bg-base-100 rounded-box w-52"
|
className="mt-3 z-[1] p-2 shadow op-menu op-menu-sm op-dropdown-content text-base-content bg-base-100 rounded-box w-52"
|
||||||
>
|
>
|
||||||
{isEnableSubscription && isTeam?.plan === "freeplan" && (
|
|
||||||
<li className="cursor-pointer">
|
|
||||||
<span>
|
|
||||||
<i className="fa-light fa-envelope"></i> Email used:{" "}
|
|
||||||
{emailUsed}/20
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
)}
|
|
||||||
<li onClick={() => openInNewTab("https://docs.opensignlabs.com")}>
|
<li onClick={() => openInNewTab("https://docs.opensignlabs.com")}>
|
||||||
<span>
|
<span>
|
||||||
<i className="fa-light fa-book"></i> {t("docs")}
|
<i className="fa-light fa-book"></i> {t("docs")}
|
||||||
@@ -241,6 +239,14 @@ const Header = ({ showSidebar }) => {
|
|||||||
<i className="fa-light fa-id-card"></i> Console
|
<i className="fa-light fa-id-card"></i> Console
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
{isEnableSubscription && isTeam?.plan === "freeplan" && (
|
||||||
|
<li className="cursor-pointer" onClick={handleMailUsed}>
|
||||||
|
<span>
|
||||||
|
<i className="fa-light fa-envelope"></i>
|
||||||
|
{emailUsed}/20 sent this month
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
)}
|
||||||
<li onClick={closeDropdown}>
|
<li onClick={closeDropdown}>
|
||||||
<span>
|
<span>
|
||||||
<i className="fa-light fa-arrow-right-from-bracket"></i>{" "}
|
<i className="fa-light fa-arrow-right-from-bracket"></i>{" "}
|
||||||
@@ -251,6 +257,9 @@ const Header = ({ showSidebar }) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ModalUi isOpen={isModal}>
|
||||||
|
<QuotaCard isPaidInfo={true} handlClose={handleMailUsed} />
|
||||||
|
</ModalUi>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ function EmailComponent({
|
|||||||
sender,
|
sender,
|
||||||
setIsAlert,
|
setIsAlert,
|
||||||
extUserId,
|
extUserId,
|
||||||
activeMailAdapter,
|
activeMailAdapter
|
||||||
planCode
|
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [emailList, setEmailList] = useState([]);
|
const [emailList, setEmailList] = useState([]);
|
||||||
@@ -51,7 +50,6 @@ function EmailComponent({
|
|||||||
recipient: emailList[i],
|
recipient: emailList[i],
|
||||||
subject: `${sender.name} has signed the doc - ${pdfName}`,
|
subject: `${sender.name} has signed the doc - ${pdfName}`,
|
||||||
from: sender.email,
|
from: sender.email,
|
||||||
plan: planCode,
|
|
||||||
html:
|
html:
|
||||||
"<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /></head><body> <div style='background-color:#f5f5f5;padding:20px'> <div style='box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;background-color:white;'> <div><img src=" +
|
"<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /></head><body> <div style='background-color:#f5f5f5;padding:20px'> <div style='box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;background-color:white;'> <div><img src=" +
|
||||||
imgPng +
|
imgPng +
|
||||||
@@ -85,12 +83,6 @@ function EmailComponent({
|
|||||||
setEmailList([]);
|
setEmailList([]);
|
||||||
}, 1500);
|
}, 1500);
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
} else if (sendMail?.data?.result?.status === "quota-reached") {
|
|
||||||
setIsLoading(false);
|
|
||||||
setIsEmail(false);
|
|
||||||
setIsAlert({ isShow: true, alertMessage: "quotareached" });
|
|
||||||
setEmailValue("");
|
|
||||||
setEmailList([]);
|
|
||||||
} else {
|
} else {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
setIsEmail(false);
|
setIsEmail(false);
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ import PdfZoom from "../components/pdf/PdfZoom";
|
|||||||
import Loader from "../primitives/Loader";
|
import Loader from "../primitives/Loader";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import RotateAlert from "../components/RotateAlert";
|
import RotateAlert from "../components/RotateAlert";
|
||||||
import QuotaCard from "../primitives/QuotaCard";
|
|
||||||
//For signYourself inProgress section signer can add sign and complete doc sign.
|
//For signYourself inProgress section signer can add sign and complete doc sign.
|
||||||
function SignYourSelf() {
|
function SignYourSelf() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -1241,29 +1240,14 @@ function SignYourSelf() {
|
|||||||
<div className="w-full md:w-[95%]">
|
<div className="w-full md:w-[95%]">
|
||||||
<ModalUi
|
<ModalUi
|
||||||
isOpen={isAlert.isShow}
|
isOpen={isAlert.isShow}
|
||||||
title={
|
title={isAlert?.header || t("alert")}
|
||||||
isAlert.alertMessage === "quotareached"
|
|
||||||
? false
|
|
||||||
: isAlert?.header || t("alert")
|
|
||||||
}
|
|
||||||
handleClose={() =>
|
handleClose={() =>
|
||||||
isAlert.alertMessage === "quotareached"
|
setIsAlert({ isShow: false, alertMessage: "" })
|
||||||
? false
|
|
||||||
: setIsAlert({ isShow: false, alertMessage: "" })
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{isAlert.alertMessage === "quotareached" ? (
|
<div className="p-[20px] h-full">
|
||||||
<QuotaCard
|
<p>{isAlert.alertMessage}</p>
|
||||||
isSignyourself={true}
|
</div>
|
||||||
handlClose={() =>
|
|
||||||
setIsAlert({ isShow: false, alertMessage: "" })
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<div className="p-[20px] h-full">
|
|
||||||
<p>{isAlert.alertMessage}</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</ModalUi>
|
</ModalUi>
|
||||||
|
|
||||||
{/* this modal is used show this document is already sign */}
|
{/* this modal is used show this document is already sign */}
|
||||||
@@ -1343,7 +1327,6 @@ function SignYourSelf() {
|
|||||||
setIsAlert={setIsAlert}
|
setIsAlert={setIsAlert}
|
||||||
extUserId={extUserId}
|
extUserId={extUserId}
|
||||||
activeMailAdapter={activeMailAdapter}
|
activeMailAdapter={activeMailAdapter}
|
||||||
planCode={isSubscribe?.plan}
|
|
||||||
/>
|
/>
|
||||||
{/* pdf header which contain funish back button */}
|
{/* pdf header which contain funish back button */}
|
||||||
<Header
|
<Header
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import React from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
const QuotaCard = ({ isSignyourself, handlClose }) => {
|
const QuotaCard = ({ isPaidInfo, handlClose }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
return isSignyourself ? (
|
return isPaidInfo ? (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className="op-btn op-btn-sm op-btn-circle op-btn-ghost text-primary-content absolute right-2 top-2 z-40"
|
className="op-btn op-btn-sm op-btn-circle op-btn-ghost text-primary-content absolute right-2 top-2 z-40"
|
||||||
@@ -18,7 +18,8 @@ const QuotaCard = ({ isSignyourself, handlClose }) => {
|
|||||||
<h2 className="op-card-title">
|
<h2 className="op-card-title">
|
||||||
{t("upgrade-to") + " Paid " + t("plan")}
|
{t("upgrade-to") + " Paid " + t("plan")}
|
||||||
</h2>
|
</h2>
|
||||||
<p>{t("quotamailselfsign")}</p>
|
<p>{t("quotamailinfo")}</p>
|
||||||
|
<p>{t("quotamailTip")}</p>
|
||||||
<div className="op-card-actions justify-end">
|
<div className="op-card-actions justify-end">
|
||||||
<button
|
<button
|
||||||
onClick={() => navigate("/subscription")}
|
onClick={() => navigate("/subscription")}
|
||||||
|
|||||||
@@ -628,9 +628,9 @@
|
|||||||
"help-test-token":"This token can be used to test the APIs at the https://sandbox.opensignlabs.com/api/v1 endpoint, allowing you to conduct unlimited document signatures. Please note that the sandbox API will sign your documents with self-signed certificates, which may not be recognized as valid by Adobe. Once you’ve completed your testing, you can upgrade to one of our paid plans to generate a production token.",
|
"help-test-token":"This token can be used to test the APIs at the https://sandbox.opensignlabs.com/api/v1 endpoint, allowing you to conduct unlimited document signatures. Please note that the sandbox API will sign your documents with self-signed certificates, which may not be recognized as valid by Adobe. Once you’ve completed your testing, you can upgrade to one of our paid plans to generate a production token.",
|
||||||
"help-api-token":"This token can be used to access the production APIs at the {{origin}}/api/v1 endpoint. It can only be generated on one of our paid plans.",
|
"help-api-token":"This token can be used to access the production APIs at the {{origin}}/api/v1 endpoint. It can only be generated on one of our paid plans.",
|
||||||
"Add-Webhook":"Add Webhook",
|
"Add-Webhook":"Add Webhook",
|
||||||
"quotamailselfsign": "You've reached your limit of 20 emails for this month. Upgrade now to continue sending emails directly.",
|
"quotamailinfo": "You can send upto 15 signature request emails every month. Upgrade now to send unlimited signing requests directly.",
|
||||||
"quotamail": "You've reached your limit of 20 signature request emails for this month. Upgrade now to continue sending emails directly.",
|
"quotamail": "You've reached your limit of 15 signature request emails for this month. Upgrade now to continue sending emails directly.",
|
||||||
"quotamailTip":"Tip: You can still sign unlimited documents by manually sharing the signing request links below.",
|
"quotamailTip":"Tip: You can still sign unlimited documents by manually sharing the signing request links.",
|
||||||
"quotamailhead":"Quota Reached",
|
"quotamailhead":"Quota Reached",
|
||||||
"unauthorized-modal":"You don't have permission to perform this action, please contact {{adminName}}<{{adminEmail}}>."
|
"unauthorized-modal":"You don't have permission to perform this action, please contact {{adminName}}<{{adminEmail}}>."
|
||||||
|
|
||||||
|
|||||||
@@ -628,9 +628,9 @@
|
|||||||
"help-test-token":"Ce jeton peut être utilisé pour tester les API au niveau du point de terminaison https://sandbox.opensignlabs.com/api/v1, vous permettant ainsi d'effectuer un nombre illimité de signatures de documents. Veuillez noter que l'API sandbox signera vos documents avec des certificats auto-signés, qui peuvent ne pas être reconnus comme valides par Adobe. Une fois vos tests terminés, vous pouvez passer à l’un de nos forfaits payants pour générer un jeton de production.",
|
"help-test-token":"Ce jeton peut être utilisé pour tester les API au niveau du point de terminaison https://sandbox.opensignlabs.com/api/v1, vous permettant ainsi d'effectuer un nombre illimité de signatures de documents. Veuillez noter que l'API sandbox signera vos documents avec des certificats auto-signés, qui peuvent ne pas être reconnus comme valides par Adobe. Une fois vos tests terminés, vous pouvez passer à l’un de nos forfaits payants pour générer un jeton de production.",
|
||||||
"help-api-token":"Ce jeton peut être utilisé pour accéder aux API de production au point de terminaison {{origin}}/api/v1. Il ne peut être généré que sur l'un de nos forfaits payants.",
|
"help-api-token":"Ce jeton peut être utilisé pour accéder aux API de production au point de terminaison {{origin}}/api/v1. Il ne peut être généré que sur l'un de nos forfaits payants.",
|
||||||
"Add-Webhook":"Ajouter Webhook",
|
"Add-Webhook":"Ajouter Webhook",
|
||||||
"quotamailselfsign": "Vous avez atteint votre limite de 20 e-mails pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.",
|
"quotamailinfo": "Vous pouvez envoyer jusqu'à 15 e-mails de demande de signature chaque mois. Mettez à niveau maintenant pour envoyer directement des demandes de signature illimitées.",
|
||||||
"quotamail": "Vous avez atteint votre limite de 20 e-mails de demande de signature pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.",
|
"quotamail": "Vous avez atteint votre limite de 15 e-mails de demande de signature pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.",
|
||||||
"quotamailTip":"Astuce : Vous pouvez toujours signer un nombre illimité de documents en partageant manuellement les liens de demande de signature ci-dessous.",
|
"quotamailTip":"Astuce : Vous pouvez toujours signer un nombre illimité de documents en partageant manuellement les liens de demande de signature.",
|
||||||
"quotamailhead":"Quota atteint",
|
"quotamailhead":"Quota atteint",
|
||||||
"unauthorized-modal":"Vous n'êtes pas autorisé à effectuer cette action, veuillez contacter {{adminName}}<{{adminEmail}}>."
|
"unauthorized-modal":"Vous n'êtes pas autorisé à effectuer cette action, veuillez contacter {{adminName}}<{{adminEmail}}>."
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ export default async function createDocumentWithTemplate(request, response) {
|
|||||||
objectId: extUser.get('TenantId').id,
|
objectId: extUser.get('TenantId').id,
|
||||||
});
|
});
|
||||||
subscription.include('ExtUserPtr');
|
subscription.include('ExtUserPtr');
|
||||||
|
subscription.greaterThanOrEqualTo('Next_billing_date', new Date());
|
||||||
const resSub = await subscription.first({ useMasterKey: true });
|
const resSub = await subscription.first({ useMasterKey: true });
|
||||||
if (resSub) {
|
if (resSub) {
|
||||||
const _resSub = JSON.parse(JSON.stringify(resSub));
|
const _resSub = JSON.parse(JSON.stringify(resSub));
|
||||||
@@ -404,7 +405,9 @@ export default async function createDocumentWithTemplate(request, response) {
|
|||||||
.json({ error: 'Quota reached, Please buy credits and try again later.' });
|
.json({ error: 'Quota reached, Please buy credits and try again later.' });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return response.status(400).json({ error: 'Please buy subscriptions.' });
|
return response.status(400).json({
|
||||||
|
error: 'Please purchase or renew your subscription.',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return response.status(405).json({ error: 'Invalid API Token!' });
|
return response.status(405).json({ error: 'Invalid API Token!' });
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ export default async function createDocumentwithCoordinate(request, response) {
|
|||||||
objectId: extUser.get('TenantId').id,
|
objectId: extUser.get('TenantId').id,
|
||||||
});
|
});
|
||||||
subscription.include('ExtUserPtr');
|
subscription.include('ExtUserPtr');
|
||||||
|
subscription.greaterThanOrEqualTo('Next_billing_date', new Date());
|
||||||
const resSub = await subscription.first({ useMasterKey: true });
|
const resSub = await subscription.first({ useMasterKey: true });
|
||||||
if (resSub) {
|
if (resSub) {
|
||||||
const _resSub = JSON.parse(JSON.stringify(resSub));
|
const _resSub = JSON.parse(JSON.stringify(resSub));
|
||||||
@@ -422,7 +423,9 @@ export default async function createDocumentwithCoordinate(request, response) {
|
|||||||
.json({ error: 'Quota reached, Please buy credits and try again later.' });
|
.json({ error: 'Quota reached, Please buy credits and try again later.' });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return response.status(400).json({ error: 'Please buy subscriptions.' });
|
return response.status(400).json({
|
||||||
|
error: 'Please purchase or renew your subscription.',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return response.status(405).json({ error: 'Invalid API Token!' });
|
return response.status(405).json({ error: 'Invalid API Token!' });
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ export default async function createBatchDocs(request) {
|
|||||||
objectId: _resExt.TenantId.objectId,
|
objectId: _resExt.TenantId.objectId,
|
||||||
});
|
});
|
||||||
subscription.include('ExtUserPtr');
|
subscription.include('ExtUserPtr');
|
||||||
|
subscription.greaterThanOrEqualTo('Next_billing_date', new Date());
|
||||||
const resSub = await subscription.first({ useMasterKey: true });
|
const resSub = await subscription.first({ useMasterKey: true });
|
||||||
if (resSub) {
|
if (resSub) {
|
||||||
const _resSub = JSON.parse(JSON.stringify(resSub));
|
const _resSub = JSON.parse(JSON.stringify(resSub));
|
||||||
@@ -240,7 +241,10 @@ export default async function createBatchDocs(request) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Parse.Error(Parse.Error.INVALID_QUERY, 'Please buy subscriptions.');
|
throw new Parse.Error(
|
||||||
|
Parse.Error.INVALID_QUERY,
|
||||||
|
'Please purchase or renew your subscription.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const response = await axios.post('batch', { requests: requests[0] }, parseConfig);
|
const response = await axios.post('batch', { requests: requests[0] }, parseConfig);
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ async function sendmailv3(req) {
|
|||||||
const nonCustomMail = await sendMailProvider(req, Plan, true);
|
const nonCustomMail = await sendMailProvider(req, Plan, true);
|
||||||
return nonCustomMail;
|
return nonCustomMail;
|
||||||
} else {
|
} else {
|
||||||
if (MonthlyFreeEmails >= 20) {
|
if (MonthlyFreeEmails >= 15) {
|
||||||
return { status: 'quota-reached' };
|
return { status: 'quota-reached' };
|
||||||
} else {
|
} else {
|
||||||
const nonCustomMail = await sendMailProvider(req, Plan);
|
const nonCustomMail = await sendMailProvider(req, Plan);
|
||||||
|
|||||||
Reference in New Issue
Block a user