

Plugin «LeadOnForm» button in the main administration menu.
LeadOnForm connects selected WordPress form submissions to Salesforce Leads through a server-side API integration. Configure Salesforce credentials in the WordPress admin, choose Sandbox or Production, test the connection, and map form fields using their Salesforce API names.
The plugin supports:
wpcf7mailsent).nfFormSubmitResponse).Main features:
sf- CSS classes; HTML field names can remain unchanged.Important: LeadOnForm does not replace the form plugin’s own validation or submission process. If the original form prevents submission, LeadOnForm does not send a Lead. Salesforce validates the data it receives; Salesforce validation errors are recorded in the LeadOnForm log.
Salesforce is a trademark of Salesforce, Inc. LeadOnForm is an independent project and is not affiliated with or endorsed by Salesforce, Inc.
The Configuration screen stores separate Sandbox and Production connection settings. The Consumer Secret is not displayed after it has been saved. The example screenshot has sensitive values hidden.
Two things are required for each form:
An opt-in hidden field with the exact name and value below:
A CSS class on each field that should be sent to Salesforce. The class must start with sf-, followed by the exact Salesforce Lead field API name.
For example:
<input type="text" name="your_first_name" class="sf-FirstName">
This sends the value to Salesforce FirstName. The HTML name attribute remains your_first_name and does not need to match the Salesforce API name.
Common field classes:
sf-FirstName — First name.sf-LastName — Last name.sf-Company — Company.sf-Email — Email address.sf-Phone — Phone.sf-MobilePhone — Mobile phone.sf-Title — Job title.sf-Website — Website.sf-Description — Description.Use the exact API name of a supported Lead field in your Salesforce organization. Salesforce permissions, required fields, validation rules, and customizations still apply.
Add the hidden field and the sf- classes to your existing HTML form. You do not need to add a special class to the <form> element.
<form id="contact-form" method="post" action="/process-contact/">
<label>First name
<input type="text" name="first_name" class="sf-FirstName">
</label>
<label>Last name
<input type="text" name="last_name" class="sf-LastName">
</label>
<label>Company
<input type="text" name="company" class="sf-Company">
</label>
<label>Email
<input type="email" name="email" class="sf-Email">
</label>
<label>Mobile
<input type="tel" name="mobile" class="sf-MobilePhone">
</label>
<input type="hidden" name="salesforce_lead" value="1">
<button type="submit">Send</button>
</form>
LeadOnForm listens for the native form submit event and sends the mapped values independently. It does not call preventDefault(), change the form action, or replace the original form submission. Browser validation such as required and type="email" remains under the browser’s control. If the browser or another script prevents the form from submitting, the native integration does not send a Lead.
Contact Form 7 is supported automatically. Edit the form in Contact Form 7 and add the hidden field and CSS classes to the relevant form-tags:
[hidden salesforce_lead "1"]
[text first_name class:sf-FirstName]
[text last_name class:sf-LastName]
[text company class:sf-Company]
[email email class:sf-Email]
[tel mobile class:sf-MobilePhone]
[submit "Send"]
LeadOnForm waits for Contact Form 7’s wpcf7mailsent event. Therefore, the Salesforce request is made only after Contact Form 7 reports a successful submission; a Contact Form 7 validation failure does not trigger the integration.
Ninja Forms is supported automatically. In the Ninja Forms builder:
sf-FirstName, sf-LastName, sf-Company, or sf-Email.salesforce_lead and its default value to 1.Ninja Forms returns submitted field values in its AJAX response. LeadOnForm reads those values, matches them to the form fields and their sf- classes, and sends the Lead after the nfFormSubmitResponse event. It does not depend on the form values still being present in the browser after Ninja Forms has processed the submission.
For a form plugin not listed above, use the documented successful-submission callback provided by that plugin. Call LeadOnForm only after the plugin confirms that its own submission and server-side validation succeeded.
JavaScript method:
LeadOnForm.send(formElement);
Example for a plugin’s success callback:
const form = document.querySelector('#my-form');
if (form) {
LeadOnForm.send(form);
}
Alternatively, dispatch the custom success event after the form plugin confirms success:
form.dispatchEvent(new CustomEvent('leadonform:form-success', { bubbles: true }));
The form must contain the salesforce_lead=1 hidden field and the mapped sf- classes. Do not call this method on the initial submit event when the form plugin may still reject the submission on its server.
When LeadOnForm receives a form submission, it sends the mapped values to the Salesforce API configured by the administrator.
Examples of outcomes:
201: Salesforce successfully created a Lead.200: Salesforce successfully updated a Lead.400 with REQUIRED_FIELD_MISSING: Salesforce rejected the request because a required field, such as LastName, was missing.400 with STRING_TOO_LONG: Salesforce rejected a value that exceeded the field’s configured maximum length.These are examples; the exact response depends on the Salesforce organization and its validation rules.
Open LeadOnForm > Logs in the WordPress admin to review recent requests. The log includes the date, environment, request ID, status, operation, masked email, form path, Salesforce Lead ID when available, HTTP status, and response detail.
The plugin retains a maximum of 200 recent events. Email addresses are masked. Full form values, OAuth tokens, and client secrets are not stored in the event log.
salesforce_lead=1.sf- class and Salesforce API field name.This means the request reached Salesforce and Salesforce rejected the data. Review the error code and message in the Detail column, then check the corresponding Salesforce field requirement, maximum length, validation rule, or permission.
LeadOnForm should only run after the form plugin confirms success. Contact Form 7 and Ninja Forms have dedicated success-event integrations. For other plugins, use their documented successful-submission callback. The original form’s own validation and submission behavior is not replaced by LeadOnForm.
Check the selected environment, Connected App credentials, Login URL, Salesforce API access, integration-user permissions, and outbound HTTPS connectivity from the WordPress server.
LeadOnForm provides these actions for optional extensions:
leadonform_submission_completed — receives an associative array after a successful Lead create or update.leadonform_submission_failed — receives an associative array after a submission error.The event payload can include request_id, environment, status, operation, http_status, salesforce_id (on success), error_code (on failure), route, and occurred_at. It does not include the full submitted form payload, full email addresses, OAuth tokens, or client secrets.
LeadOnForm sends selected form fields to the Salesforce instance configured by the site administrator. The plugin stores its configuration and a bounded event log in the WordPress database. Email addresses in the log are masked, and the complete submitted form payload is not stored. Site administrators are responsible for providing appropriate privacy notices, obtaining any required consent, and complying with applicable data-protection and retention requirements.