class TestMailSystemOverride in Sparkpost email 8.2
Example configuration override.
Hierarchy
- class \Drupal\sparkpost\TestMailSystemOverride implements ConfigFactoryOverrideInterface
Expanded class hierarchy of TestMailSystemOverride
2 string references to 'TestMailSystemOverride'
- sparkpost.services.yml in ./
sparkpost.services.yml - sparkpost.services.yml
- TestMailSystemOverride::getCacheSuffix in src/
TestMailSystemOverride.php - The string to append to the configuration static cache name.
1 service uses TestMailSystemOverride
File
- src/
TestMailSystemOverride.php, line 12
Namespace
Drupal\sparkpostView source
class TestMailSystemOverride implements ConfigFactoryOverrideInterface {
/**
* {@inheritdoc}
*/
public function loadOverrides($names) {
$overrides = [];
if (in_array('system.mail', $names)) {
// Use if default MailManager in use.
$overrides['system.mail']['interface']['sparkpost_test_mail_form'] = 'sparkpost_mail';
}
if (in_array('mailsystem.settings', $names)) {
// Use if mailsystem module is enabled.
$overrides['mailsystem.settings']['modules']['sparkpost']['test_mail_form']['formatter'] = 'sparkpost_mail';
$overrides['mailsystem.settings']['modules']['sparkpost']['test_mail_form']['sender'] = 'sparkpost_mail';
}
return $overrides;
}
/**
* {@inheritdoc}
*/
public function getCacheSuffix() {
return 'TestMailSystemOverride';
}
/**
* {@inheritdoc}
*/
public function getCacheableMetadata($name) {
return new CacheableMetadata();
}
/**
* {@inheritdoc}
*/
public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
return NULL;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TestMailSystemOverride:: |
public | function |
Creates a configuration object for use during install and synchronization. Overrides ConfigFactoryOverrideInterface:: |
|
TestMailSystemOverride:: |
public | function |
Gets the cacheability metadata associated with the config factory override. Overrides ConfigFactoryOverrideInterface:: |
|
TestMailSystemOverride:: |
public | function |
The string to append to the configuration static cache name. Overrides ConfigFactoryOverrideInterface:: |
|
TestMailSystemOverride:: |
public | function |
Returns config overrides. Overrides ConfigFactoryOverrideInterface:: |