You are here

hubspot.install in HubSpot 8

Installation file for hubspot.

File

hubspot.install
View source
<?php

/**
 * @file
 * Installation file for hubspot.
 */
use Drupal\Core\Url;
use Drupal\Core\Link;
use Drupal\hubspot\Plugin\WebformHandler\HubspotWebformHandler;

/**
 * Implements hook_install().
 */
function hubspot_install() {
  $site_mail = \Drupal::config('system.site')
    ->get('mail');
  \Drupal::configFactory()
    ->getEditable('hubspot.settings')
    ->set('hubspot_debug_email', $site_mail)
    ->save();
  \Drupal::messenger()
    ->addStatus(t('The HubSpot module has been successfully installed. Configure it in the @link.', [
    '@link' => Link::fromTextAndUrl(t('HubSpot integration settings'), Url::fromRoute('hubspot.admin_settings')),
  ]));
}

/**
 * Implements hook_uninstall().
 */
function hubspot_uninstall() {
  \Drupal::configFactory()
    ->getEditable('hubspot.settings')
    ->delete();
}

Functions

Namesort descending Description
hubspot_install Implements hook_install().
hubspot_uninstall Implements hook_uninstall().