You are here

social_auth_extra.install in Open Social 8.3

Contains social_auth_extra.instal.

File

modules/custom/social_auth_extra/social_auth_extra.install
View source
<?php

/**
 * @file
 * Contains social_auth_extra.instal.
 */

/**
 * Change 'edit account' to 'settings' in registration mail.
 */
function social_auth_extra_update_8001(&$sandbox) {

  // Get config.
  $config = \Drupal::service('config.factory')
    ->getEditable('social_auth_extra.mail');

  // Fetch the body field.
  $body = $config
    ->get('email_social_login.body');

  // Replace 'edit account' with 'settings'.
  $new_body = str_replace('edit account', 'settings', $body);

  // And save it.
  $config
    ->set('email_social_login.body', $new_body)
    ->save();
}

/**
 * Create the default configuration for the social_auth_extra help texts.
 */
function social_auth_extra_update_8002() {
  $config = [
    "langcode" => "en",
    "social_signup_help" => "If you connect using a social account, the email address and name associated with that account will be suggested for you but you can feel free to change them.",
    "social_login_help" => "",
  ];
  \Drupal::configFactory()
    ->getEditable('social_auth_extra.settings')
    ->setData($config)
    ->save();
}

Functions

Namesort descending Description
social_auth_extra_update_8001 Change 'edit account' to 'settings' in registration mail.
social_auth_extra_update_8002 Create the default configuration for the social_auth_extra help texts.