06-plugin_settings.php 865 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace cx_newsletter;
  3. use \exception;
  4. class plugin_settings
  5. extends settings
  6. implements settings_interface {
  7. protected function get_options() : array {
  8. return [
  9. 'source_address' => '[email protected]',
  10. 'reply_to_address' => '[email protected]',
  11. 'email_count' => '50',
  12. 'sms_count' => '10',
  13. 'database_version' => 'null',
  14. 'apikey' => 'CHANGE_ME_CHANGE_IT_PLEASE',
  15. 'custom_smtp' => 'false',
  16. 'smtp_address' => 'smtp.example.com',
  17. 'smtp_port' => '465',
  18. 'smtp_user' => 'example',
  19. 'smtp_password' => 'QWERTY1234'
  20. ];
  21. }
  22. public function use_custom_smtp() : bool {
  23. return $this->get('custom_smtp') === 'true';
  24. }
  25. public function get_plugin_version() : int {
  26. return 2;
  27. }
  28. }