update zoho url

This commit is contained in:
2025-02-24 18:37:23 +05:30
parent 79c6e53eb9
commit 5559b2d296

View File

@@ -11,7 +11,7 @@ export async function getToken() {
} }
const res = await axios({ const res = await axios({
url: `https://accounts.zoho.com/oauth/v2/token?refresh_token=${process.env.ZOHO_REFRESH_TOKEN}&grant_type=refresh_token&client_id=${process.env.ZOHO_CLIENT_ID}&client_secret=${process.env.ZOHO_CLIENT_SECRET}`, url: `https://accounts.zoho.eu/oauth/v2/token?refresh_token=${process.env.ZOHO_REFRESH_TOKEN}&grant_type=refresh_token&client_id=${process.env.ZOHO_CLIENT_ID}&client_secret=${process.env.ZOHO_CLIENT_SECRET}`,
method: "POST", method: "POST",
}); });
@@ -35,13 +35,13 @@ export async function sendMail(
const token = await getToken(); const token = await getToken();
const res = await axios({ const res = await axios({
url: `https://mail.zoho.com/api/accounts/${process.env.ZOHO_ACCOUNT_ID}/messages`, url: `https://mail.zoho.eu/api/accounts/${process.env.ZOHO_ACCOUNT_ID}/messages`,
method: "POST", method: "POST",
headers: { headers: {
Authorization: `Zoho-oauthtoken ${token}`, Authorization: `Zoho-oauthtoken ${token}`,
}, },
data: { data: {
fromAddress: "akhil.reddy@qualyval.com", fromAddress: "qp.automation@saveefforts.com",
toAddress: to, toAddress: to,
subject, subject,
content: body, content: body,