Confidential comtact form that doesn't store submissions

Hi. I want to have a contact form on my website where users can submit personal, confidential message that gets sent to an email address. I DON’T want the submission to get saved in Wix, where other site collaborators have access to.
Just need a simple form that will send the input via email.
Is this possible?l

Hi, Yuri_Vidal !!

If you can work with Velo, I believe it’s possible. Velo has an API for sending emails, so please utilize that (or you can contract with a third-party email sending service outside of Wix and use that service’s API).

https://dev.wix.com/docs/velo/api-reference/wix-crm-backend/triggered-emails/introduction

However, if you use Wix’s email API, you cannot set your email address as the sender. (You can set your email address as the reply-to address for the sent email.) If you also want to set your own email address as the sender, you will need to use a third-party API like Mailgun.

What you need to do is program the backend code to send the email, the minimum UI (such as a text input field and send button) to place on the frontend page, and the process to call the backend code when the send button is pressed. If you are using Wix’s email sending API, you will need to use something like a user ID to send the email, so the recipient’s email address must be saved as a contact. :wink: :+1:

Thanks. I think i’m almost there, but i’m getting an error on my code.

// Import wixCRM and triggeredEmails for sending email
import wixCRM from 'wix-crm';
import { triggeredEmails } from 'wix-crm';

$w.onReady(function () {
    // Attach the submit button's event handler
    $w('#submitButton').onClick(() => {
        sendFormData();  // Call the function when the button is clicked
    });
});

function sendFormData() {
    // Collect data from the form inputs
    let nameInput = $w('#nameInput').value;
    let emailInput = $w('#emailInput').value;
    let messageInput = $w('#messageInput').value;

    // Send the email
    triggeredEmails.emailContact('URj14c4', '9d37db13-b2ac-4024-b35b-a09896f6c148', {
        variables: {
            nameInput: nameInput,
            emailInput: emailInput,
            messageInput: messageInput
        }
    }).then(() => {
        // Show success message
        $w('#successMessage').show();
    }).catch((error) => {
        console.error('Error sending email:', error);
        // Show error message
        $w('#errorMessage').show();
    });
}

I’m getting error: Error sending email: Not Found: the requested item no longer exists.

What am i doing wrong? perhaps i have the wrong user id? if so, where can i get the actual user ID for the site user that i want to be receiving the email?

I apologize. I accidentally posted a link for frontend use. Generally, for security reasons, such processes should be handled on the backend. Please refer to this link instead. :melting_face:

https://dev.wix.com/docs/velo/api-reference/wix-crm-backend/triggered-emails/introduction

Did you perhaps use AI to generate that code? It seems a bit outdated. Try referring to the official documentation and adjusting the part where you’re importing libraries. Also, if possible, avoid hardcoding IDs. :thinking:

Hey Yuri,

As @onemoretime mentioned, you can third party alternatives like SendGrid to achieve this. Here’s an example template of how to set up an email form using SendGrid in your Wix website:

By the way, it seems that SendGrid can now only be used by businesses, not individuals. So if that’s inconvenient for you, please consider other services like Mailgun and so on. :wink: