X
Exclusive Access to Our  AI Agents White Paper
Exclusive Access to Our  
 AI Agents White Paper

Enter your email to receive the document link in your inbox.

Get the White Paper
` const headers = { Accept: "application/json, text/plain, */*", "Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8", "Cache-Control": "no-cache", Connection: "keep-alive", "x-fn7-host": "helix.dev.app.fn7.io", "Content-Type": "application/json", }; // Function to send the email const sendEmail = async (recipient) => { //to submit form submitBtn.click(); const { email, name } = recipient; // Interpolate name into subject and body const subject = subjectTemplate; const body = bodyTemplate.replace("__ReceiverName__", name); const successMessage = document.getElementById("AI-agent-mail-success-msg"); successMessage.textContent = `Email sent successfully!`; successMessage.style.display = "block"; new Promise((resolve) => setTimeout(resolve, 1000)); emailInput.value = ''; successMessage.textContent = ''; mailIDtext.textContent = email; errorMessage.textContent = ''; successMessage.style.display = 'none'; errorMessage.style.display = 'none'; confirmationpopup.style.display = 'flex'; contentpopup.style.display = 'none'; const data = { to: [{ email }], from: fromEmail, subject, body, }; try { const response = await fetch( "https://helix.dev.app.fn7.io/api/send-email", { method: "PUT", headers: headers, body: JSON.stringify(data), } ); if (response.ok) { console.log(`Email sent to ${name} at ${email}:`, response.status); } else { console.error( `Failed to send email to ${name} at ${email}:`, response.statusText ); } } catch (error) { console.error(`Error sending email to ${name} at ${email}:`, error); } }; function formSubmit(){ const email = emailInput.value.trim(); // Check if the email is empty if (!email) { errorMessage.textContent = "Please enter your email."; console.log('Please enter your email."'); errorMessage.style.color = "red"; errorMessage.style.display = "block"; return; } // Validate email format using regex if (!validateEmail(email)) { errorMessage.textContent = "Please enter a valid email address."; console.log("Please enter a valid email address."); errorMessage.style.color = "red"; errorMessage.style.display = "block"; return; } console.log("Mail Sent..."); // Clear error message errorMessage.textContent = ""; let name; if (typeof email !== "string") { name = "Hi"; } else { name = `Hi, ${email.split("@")[0]}`; } // Send email using EmailJS const recipient = { name: name, email: email }; sendEmail(recipient); } // Function to validate email format function validateEmail(email) { const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; return emailPattern.test(email); } sendButton.addEventListener("click", function (event) { event.preventDefault(); // Prevent default form submission formSubmit() }); emailForm.addEventListener("keydown", function (event) { if (event.key === "Enter") { event.preventDefault(); formSubmit() } }); // Function to send email using EmailJS // Global variables for from email, subject, body, and delay });
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

✅ Your email is safe with us. No spam, just insights!

✅ Check your inbox for the download link after submission.

You're All Set!

We've sent the white paper to your email: [email protected]

Check your inbox. Enjoy the insights

The Future of AI

Create, Deploy, and Manage Intelligent Agents with fn7

fn7 is building a next-generation AI Agent Factory that combines creative, passive, conversational, and active agent types for complete business transformation.
Download the White Paper

AI Agents Explained

Turn expertise into intelligent action.

OSZAR »