Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
v2.5.18
Browse files Browse the repository at this point in the history
  • Loading branch information
kjmartens committed Apr 18, 2019
1 parent aab8903 commit 8de147a
Show file tree
Hide file tree
Showing 5 changed files with 341 additions and 77 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Solspace Freeform Changelog

## 2.5.18 - 2019-04-18
### Added
- Added Active Campaign mailing list API integration (Pro edition).
- Added `EVENT_AFTER_GENERATE_RETURN_URL` developer event, allowing modifying of the return URL of forms.

### Changed
- Updated the HubSpot integration to not create blank Deals if no Freeform data is mapped to Deal fields.
- Updated the HubSpot integration to include an IP Address mapping setting, allowing you to map IP addresses to a custom field in Contacts.

## 2.5.17 - 2019-04-08
### Added
- Added a `getTagAttributes()` function to the Form component.
Expand Down
56 changes: 4 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,10 @@
# Solspace Freeform plugin for Craft CMS 3.x

Freeform is the most powerful form building plugin for Craft CMS. It gives you full control to create simple or complex multi-page forms, as well as connect your forms to many popular API integrations.
Freeform is the most reliable, intuitive and powerful form builder for Craft. Effortlessly build beautiful forms in minutes!

![Screenshot](src/icon.svg)

## Requirements

* **Craft 3.0.0 or later**
* PHP 7.0+
* MySQL 5.5+ (with InnoDB) or PostgreSQL 9.5+
* [BC Math](http://php.net/manual/en/book.bc.php) or [GMP](http://php.net/manual/en/book.gmp.php) PHP extensions (usually included in most server environments)
* Windows and OS X browsers:
* Chrome 29 or later
* Firefox 28 or later
* Safari 9.0 or later
* Internet Explorer 11 or later
* Microsoft Edge

## Installation

To install Freeform, simply:

1. Go to the **Plugin Store** area inside your Craft control panel and search for *Freeform*.
2. Choose to install *Freeform Lite* and/or *Freeform Pro* (*Pro* requires *Lite* to be installed) by clicking on them.
3. Click on the **Try** button to install a trial copy of Freeform.
4. Try things out and if Freeform is right for your site, and then purchase a copy of it through the Plugin Store when you're ready!

Freeform can also be installed manually through Composer:

1. Open your terminal and go to your Craft project: `cd /path/to/project`
2. Then tell Composer to require the plugin: `composer require solspace/craft3-freeform`
3. If you'd like Freeform Pro, also run: `composer require solspace/craft3-freeform-pro`
4. In the Craft control panel, go to *Settings → Plugins* and click the **Install** button for Freeform Lite (and Freeform Pro if you're using Pro edition).

## Freeform Overview

Freeform centers itself around the idea of letting admins and/or clients enjoy the experience of building and managing simple or complex forms in an intuitive interface that lets you see a live preview of the forms you're building. We call this Composer, where almost everything is at your fingertips as it aims to stay out of your way and let you do as much as possible without having to move around to other areas in the control panel. At the same time, Freeform is very powerful and flexible, so there is also a wide variety of other features, settings and options.

Freeform uses its own set of fields and field types. Fields are global and available to all forms, but they can also be overwritten per form. This allows you to save time reusing existing fields when making other forms, but also gives you flexibility to make adjustments to them when needed. So to clarify, you can create fields with labels and options that are common to all forms, but also override those on each form. An advanced set of fields are available with purchase of Freeform Pro.

Email notifications are global and can be reused for multiple forms, saving you time when you are managing many forms. Freeform allows you to send email notifications upon submittal of a form 5 different ways, each with their own content/template. Email templates can be managed within Craft control panel (saved to database), or as HTML template files.

Freeform attempts to do all the heavy lifting when it comes to templating. Our looping templating approach allows you to automate all or almost all of your form formatting.

Freeform also allows for true multi-page forms, has its own built in spam protection service, and Freeform Pro supports several popular Mailing List and CRM (Customer Relationship Management) API integrations, including MailChimp, dotmailer, Constant Contact, Campaign Monitor, Salesforce and HubSpot.
Freeform also allows for true multi-page forms, has its own built in spam protection service (including **reCAPTCHA** for *Pro* edition), allows you to map/connect your submission data to Craft Elements, and *Freeform Pro* supports several popular Mailing List and CRM (Customer Relationship Management) API integrations, including MailChimp, Constant Contact, Campaign Monitor, Salesforce, HubSpot and Pipedrive.

Freeform Pro edition also includes Conditional Rules logic that can be added to forms. This feature allows you to effortlessly set fields to show or hide based on the contents/selection of other fields, and even skip pages based on the contents/selection of fields on a previous page.

Also available for Freeform is the [Freeform Payments](http://docs.solspace.com/craft/freeform/v2/api-integrations/payments/) add-on plugin, which adds support for Stripe payments on forms. Works with both Lite and Pro editions.

Last but not least, included with Freeform is a set of Demo Templates that can be installed on your site, instantaneously giving you a real-world set of styled, working templates.


## Using Freeform
## Overview
Freeform is the most reliable, intuitive and powerful form building plugin for Craft. Everything is at your fingertips in our elegant form builder. It gives you full control to create simple or complex multi-page forms, as well as connect your forms to many popular API integrations. Templating is easy and highly customizable. Our ready-to-go templates and features will have you ready in minutes! No other form plugin even comes close to comparing! Stop wasting valuable development hours wrestling with and tuning the Craft Contact Form or other alternatives. You can trust Freeform (and the team behind it) to deliver the quality and support you expect and deserve.

## Documentation
Full documentation for Freeform can be found on the [Solspace documentation website](http://docs.solspace.com/craft/freeform/v2/).
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "solspace/craft3-freeform-pro",
"description": "Adds API integrations, reCAPTCHA, conditional rules logic, premium field types, advanced exporting and widgets to Freeform.",
"version": "2.5.17",
"version": "2.5.18",
"type": "craft-plugin",
"authors": [
{
Expand Down
66 changes: 42 additions & 24 deletions src/Integrations/CRM/HubSpot.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
use Solspace\Freeform\Library\Integrations\DataObjects\FieldObject;
use Solspace\Freeform\Library\Integrations\IntegrationStorageInterface;
use Solspace\Freeform\Library\Integrations\SettingBlueprint;
use Solspace\Freeform\Library\Logging\LoggerInterface;

class HubSpot extends AbstractCRMIntegration
{
const SETTING_API_KEY = 'api_key';
const TITLE = 'HubSpot';
const LOG_CATEGORY = 'HubSpot';
const SETTING_API_KEY = 'api_key';
const SETTING_IP_FIELD = 'ip_field';

const TITLE = 'HubSpot';
const LOG_CATEGORY = 'HubSpot';

/**
* Returns a list of additional settings for this integration
Expand All @@ -42,6 +43,12 @@ public static function getSettingBlueprints(): array
'Enter your HubSpot API key here.',
true
),
new SettingBlueprint(
SettingBlueprint::TYPE_TEXT,
self::SETTING_IP_FIELD,
'IP Address Field',
'Enter a custom HubSpot Contact field handle where you wish to store the client\'s IP address from the submission (optional).'
),
];
}

Expand Down Expand Up @@ -83,6 +90,13 @@ public function pushObject(array $keyValueList): bool

$contactId = null;
if ($contactProps) {
if ($this->getSetting(self::SETTING_IP_FIELD) && isset($_SERVER['REMOTE_ADDR'])) {
$contactProps[] = [
'value' => $_SERVER['REMOTE_ADDR'],
'property' => $this->getSetting(self::SETTING_IP_FIELD),
];
}

try {
$response = $client->post(
$this->getEndpoint('/contacts/v1/contact'),
Expand Down Expand Up @@ -142,33 +156,37 @@ public function pushObject(array $keyValueList): bool
}
}

$deal = [
'properties' => $dealProps,
];
if (!empty($dealProps)) {
$deal = [
'properties' => $dealProps,
];

if ($companyId || $contactId) {
$deal['associations'] = [];
if ($companyId || $contactId) {
$deal['associations'] = [];

if ($companyId) {
$deal['associations']['associatedCompanyIds'] = [$companyId];
}
if ($companyId) {
$deal['associations']['associatedCompanyIds'] = [$companyId];
}

if ($contactId) {
$deal['associations']['associatedVids'] = [$contactId];
if ($contactId) {
$deal['associations']['associatedVids'] = [$contactId];
}
}
}

$response = $client->post(
$endpoint,
[
'json' => $deal,
'query' => ['hapikey' => $this->getAccessToken()],
]
);
$response = $client->post(
$endpoint,
[
'json' => $deal,
'query' => ['hapikey' => $this->getAccessToken()],
]
);

$this->getHandler()->onAfterResponse($this, $response);
$this->getHandler()->onAfterResponse($this, $response);

return $response->getStatusCode() === 200;
}

return $response->getStatusCode() === 200;
return true;
}

/**
Expand Down
Loading

0 comments on commit 8de147a

Please sign in to comment.