PHP Config File
Everything on the plugin's Settings page can also be managed via PHP in a config file. By setting these values in config/notifier.php
, they take precedence over whatever may be set in the control panel.
# Copy this file...
/vendor/doublesecretagency/craft-notifier/src/config.php
# To here... (and rename it)
/config/notifier.php
Much like the db.php
and general.php
files, notifier.php
is environmentally aware. You can also pass in environment values using the getenv
PHP method.
return [
// Twilio (only needed if using Twilio to send SMS messages)
'twilioAccountSid' => getenv('TWILIO_ACCOUNT_SID'),
'twilioAuthToken' => getenv('TWILIO_AUTH_TOKEN'),
'twilioPhoneNumber' => getenv('TWILIO_PHONE_NUMBER'),
// Phone number to use for SMS testing purposes
'testToPhoneNumber' => getenv('TEST_TO_PHONE_NUMBER'),
// Customize the Twig sandbox configuration
'twigSandboxMode' => 'append',
'twigSandboxBlacklist' => [], // Do not use both lists
'twigSandboxWhitelist' => [] // at the same time
];
Settings available via Control Panel
Twilio API credentials can also be managed on the Settings page (preferably using env
values).
Learn more about managing your Twilio API credentials.
Settings available only via PHP file
testToPhoneNumber
string|null - Defaults to null
.
Recipient phone number to intercept all outbound SMS messages. Similar to testToEmailAddress
.
Set the testing phone number in your local .env
file, then load it via the PHP config file:
# Testing phone number in local environment
TEST_TO_PHONE_NUMBER="888-555-4444"
Twig Sandbox
Configuration Instructions
For more details on how to use this powerful feature, please consult the Twig Sandbox page.
twigSandboxMode
string - Defaults to append
.
Determines how the supplied Twig specifications should be handled.
append
- Add the Twig specs to the list.except
- Remove the Twig specs from the list.override
- Replace the entire list with the Twig specs.disabled
- Completely disable the sandbox (not recommended).
twigSandboxBlacklist
array - Defaults to an empty array.
Enables and modifies the default blacklist.
twigSandboxWhitelist
array - Defaults to an empty array.
Enables and modifies the default whitelist.
Don't use both lists!
Either the blacklist or the whitelist can be used, but not both.
If both (or neither) lists are specified, the blacklist will take precedence.