2017 © Pedro Peláez
 

craft-plugin craft-salesforceleads

Generate Salesforce leads from form submissions.

image

lukeyouell/craft-salesforceleads

Generate Salesforce leads from form submissions.

  • Monday, July 30, 2018
  • by lukeyouell
  • Repository
  • 0 Watchers
  • 9 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 130 % Grown

The README.md

icon, (*1)

Salesforce Leads plugin for Craft CMS 3.x

Generate Salesforce leads from form submissions., (*2)

Requirements

This plugin requires Craft CMS 3.0.0 or later., (*3)

Installation

To install the plugin, follow these instructions., (*4)

  1. Open your terminal and go to your Craft project:, (*5)

    cd /path/to/project
  2. Then tell Composer to load the plugin:, (*6)

    composer require lukeyouell/craft-salesforceleads
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Salesforce Leads., (*7)

Usage

Your form template can look something like this:, (*8)



{{ csrfInput() }}

Salesforce Parameters

The following Salesforce parameters are available but must contain hashed values to prevent tampering., (*9)

Name Required Default Value
oid No Value set in settings/config
retURL No Current site base url
lead_source No Null
Campaign_ID No Null

The above field names are case-sensitive., (*10)

Redirecting After Submit

If you have a redirect hidden input, the user will be redirected to it upon successful submission. Again, this must be a hashed value., (*11)

If you don't have a redirect hidden input, the plugin will respond with json., (*12)

Honeypot Captcha

To configure the Honeypot Captcha, go to Settings → Salesforce Leads and choose a param name that your honeypot field should have., (*13)

Then edit your form template(s), adding the honeypot field:, (*14)

<input class="hidden" type="text" name="secretHoneypotParamName">

You can hide the field with CSS:, (*15)

.hidden {
  display: none;
}

Email Validation

If you have the Email Validator plugin installed you can validate the email addresses being used to submit Salesforce leads., (*16)

To configure the Email Validator, go to Settings → Salesforce Leads, choose a param name that your email field should have and toggle the validation processes you wish to enforce., (*17)

Ajax Submissions

You can optionally post contact form submissions over Ajax if you’d like. Just send a POST request to your site with all of the same data that would normally be sent:, (*18)

$('#myForm').submit(function(ev) {
  // Prevent the form from actually submitting
  ev.preventDefault();

  // Send it to the server
  $.post({
    url: '/',
    dataType: 'json',
    data: $(this).serialize(),
    success: function(response) {
      if (response.success) {
        alert('Successful submission.');
      } else {
        alert('An error occurred. Please try again.');
      }
    }
  });
});

Handling Responses

We are posting to Salesforce using a HTTP POST request, so we don't receive any meaningful feedback. The request will only error if there is a problem with the request itself., (*19)

Successful

{
   "success": true,
   "statusCode": 200,
   "reason": "OK",
   "body": "\r\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<html>\n<head>\n<meta HTTP-EQUIV=\"PRAGMA\" CONTENT=\"NO-CACHE\">\n<meta http-equiv=\"Refresh\" content=\"0; URL=https://www.yoursite.com/\">\n</head>\n<script>if (this.SfdcApp && this.SfdcApp.projectOneNavigator) { SfdcApp.projectOneNavigator.handleRedirect('https://www.yoursite.com/'); }  else if (window.location.replace){ window.location.replace('https://www.yoursite.com/');} else {;window.location.href ='https://www.yoursite.com/';} </script></html>\n",
   "payload": {
      "Campaign_ID": "FA4316257629E",
      "name": "Joe Bloggs",
      "email": "joe.bloggs@email.com",
      "message": "Ut felis ipsum, pulvinar id elit in, tempor sagittis lacus. In lectus quam, consequat eu nibh vel, maximus lobortis sapien.",
      "oid": "936A151D88D8C",
      "retURL": "https://www.yoursite.com",
      "lead_source": "Web"
   }
}

Unsuccessfull

{
   "success": false,
   "reason": "Error message will be shown here",
   "payload": {
      "Campaign_ID": "FA4316257629E",
      "name": "Joe Bloggs",
      "email": "joe.bloggs@email.com",
      "message": "Ut felis ipsum, pulvinar id elit in, tempor sagittis lacus. In lectus quam, consequat eu nibh vel, maximus lobortis sapien.",
      "oid": "936A151D88D8C",
      "retURL": "https://www.yoursite.com",
      "lead_source": "Web"
   }
}

Salesforce Leads Roadmap

Some things to do, and ideas for potential features:, (*20)

The Versions

30/07 2018

v1.x-dev

1.9999999.9999999.9999999-dev

Generate Salesforce leads from form submissions.

  Sources   Download

MIT

The Requires

 

cms salesforce craftcms craft-plugin craft salesforce leads

16/04 2018

1.0.2

1.0.2.0

Generate Salesforce leads from form submissions.

  Sources   Download

MIT

The Requires

 

cms salesforce craftcms craft-plugin craft salesforce leads

11/04 2018

1.0.1

1.0.1.0

Generate Salesforce leads from form submissions.

  Sources   Download

MIT

The Requires

 

cms salesforce craftcms craft-plugin craft salesforce leads

13/02 2018

1.0.0

1.0.0.0

Generate Salesforce leads from form submissions.

  Sources   Download

MIT

The Requires

 

cms salesforce craftcms craft-plugin craft salesforce leads