Добавить форму заявок и серверную отправку лидов в EspoCRM
All checks were successful
Auto Deploy / deploy (push) Successful in 16s
All checks were successful
Auto Deploy / deploy (push) Successful in 16s
This commit is contained in:
@@ -48,7 +48,13 @@ export async function POST(request: Request) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const descriptionParts = [message || "Заявка с сайта"];
|
const descriptionParts = [`Объект/компания: ${name}`];
|
||||||
|
|
||||||
|
if (message) {
|
||||||
|
descriptionParts.push(message);
|
||||||
|
} else {
|
||||||
|
descriptionParts.push("Заявка с сайта");
|
||||||
|
}
|
||||||
|
|
||||||
if (email) {
|
if (email) {
|
||||||
descriptionParts.push(`Email: ${email}`);
|
descriptionParts.push(`Email: ${email}`);
|
||||||
@@ -56,6 +62,7 @@ export async function POST(request: Request) {
|
|||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
name,
|
name,
|
||||||
|
accountName: name,
|
||||||
phoneNumber,
|
phoneNumber,
|
||||||
emailAddress: email,
|
emailAddress: email,
|
||||||
description: descriptionParts.join("\n"),
|
description: descriptionParts.join("\n"),
|
||||||
|
|||||||
Reference in New Issue
Block a user