fix webmcp
All checks were successful
Build and Deploy WebMCP Stack / build-and-push (push) Successful in 39s
All checks were successful
Build and Deploy WebMCP Stack / build-and-push (push) Successful in 39s
This commit is contained in:
parent
be2e6d8953
commit
f4e5594882
@ -53,18 +53,14 @@ async function submitContact(params) {
|
||||
email: params.email,
|
||||
subject: params.subject,
|
||||
message: params.message,
|
||||
consent: true,
|
||||
phone: params.phone || "",
|
||||
company: params.company || "",
|
||||
website: "", // Honeypot
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await fetch("api/contact.php", {
|
||||
const response = await fetch("api/send-email.php", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Source": "webmcp_tool",
|
||||
"X-Source": "web_form",
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
@ -72,7 +68,7 @@ async function submitContact(params) {
|
||||
const result = await response.json();
|
||||
|
||||
if (result.success) {
|
||||
return `Message sent successfully! Ticket ID: ${result.ticketId}`;
|
||||
return result.message;
|
||||
} else {
|
||||
throw new Error(result.message || "Failed to send message.");
|
||||
}
|
||||
@ -85,7 +81,7 @@ const submitContactTool = {
|
||||
execute: submitContact,
|
||||
name: "submitContact",
|
||||
description:
|
||||
"Submits the contact form with the provided information. All fields except phone and company are required.",
|
||||
"Submits the contact form with the provided information. All fields are required.",
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
@ -102,16 +98,6 @@ const submitContactTool = {
|
||||
minLength: 1,
|
||||
maxLength: 100,
|
||||
},
|
||||
phone: {
|
||||
type: "string",
|
||||
description: "Phone number (optional)",
|
||||
maxLength: 20,
|
||||
},
|
||||
company: {
|
||||
type: "string",
|
||||
description: "Company name (optional)",
|
||||
maxLength: 100,
|
||||
},
|
||||
subject: {
|
||||
type: "string",
|
||||
description: "Subject of the message",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user