Skip to content

coUrbanize/ember-hubspot-form

Repository files navigation

ember-hubspot-form

Build Status Ember Observer Score

A thin wrapper around Hubspot Forms to make integration in Ember Apps easier.

Installation

Install this addon with Ember CLI:

ember install ember-hubspot-form

Configuration

config/environment.js

const ENV = {
  // ...

  APP: {
    hubspot: {
      region: 'na1',
      portalId: '000000',
      formId: '00000000-0000-0000-0000-00000000000',
    },

    // ...

  },
};

Usage

Add the component to one of your templates:

<HubspotForm
  @onFormSubmitted={{noop}}
  as |hubspotForm|
>
  <hubspotForm.Content as |data|>
    <button
      type="button"
      class="checkbox"
      disabled={{not data.isFormReady}}
      {{on "click" data.onCheckboxChange}}
    >
      checkbox
    </button>
    <input
      class="email-input"
      disabled={{data.isInputDisabled}}
      {{on "input" data.onInput}}
    />
    <button 
      type="button" 
      class="submit-button"
      disabled={{data.isInputDisabled}}
      {{on "click" data.onSubmit}}
    >
      submit-button
    </button>
    {{#if data.error}}
      <div class="error">error:{{data.error}}</div>
    {{/if}}
  </hubspotForm.Content>
  <hubspotForm.Success>
    <div class="success">success</div>
  </hubspotForm.Success>
</HubspotForm>

Please see the Hubspot Form documentation for all details.

Contributing

See the Contributing guide for details.

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

License

This project is licensed under the MIT License.