You are here

function hook_default_pet in Previewable email templates 8.4

Same name and namespace in other branches
  1. 8 pet.api.php \hook_default_pet()
  2. 8.3 pet.api.php \hook_default_pet()
  3. 7 pet.api.php \hook_default_pet()

Implementation of hook_default_ENTITY_TYPE.

Return value

An array of default previewable email templates, keyed by machine names.

See also

hook_default_pet_alter()

Related topics

File

./pet.api.php, line 43
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function hook_default_pet() {
  $defaults['some_default_pet'] = \Drupal::service('entity_type.manager')
    ->getStorage('pet')
    ->create(array(
    'name' => 'some_default_pet',
    'title' => 'some default pet title',
    'subject' => 'subject',
    'mail_body' => 'body default',
    'from_override' => NULL,
    'cc_default' => 'cc@example.com',
    'bcc_default' => 'bcc@example.com',
    'recipient_callback' => 'MY_MODULE_recipients_callback',
  ));
  return $defaults;
}