hubspot.install in HubSpot 3.x
Same filename and directory in other branches
Installation file for hubspot.
File
hubspot.installView 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
Name | Description |
---|---|
hubspot_install | Implements hook_install(). |
hubspot_uninstall | Implements hook_uninstall(). |