EmailConfigFieldEnum.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Repositories\Enums;
  3. enum EmailConfigFieldEnum: string
  4. {
  5. case OPEN_EMAIL_NOTIFICATION = "email_notification"; //邮件通知
  6. public static function checkRules(): array
  7. {
  8. return [
  9. "email_notification" => "in:on,off",
  10. "async_sender" => "in:yes,no",
  11. "sender_email" => "nullable|email",
  12. "sender" => "nullable|min:1",
  13. "domain" => "nullable|url",
  14. "smtp_server" => "nullable|min:1",
  15. "smtp_account" => "nullable|min:1",
  16. "smtp_validation" => "in:yes,no",
  17. "smtp_port" => "nullable|numeric",
  18. "encryption" => "in:ssl,plain,tls",
  19. "smtp_password" => "nullable|min:6",
  20. "debug" => "in:off,normal,high",
  21. "charset" => "in:utf8,gbk"
  22. ];
  23. }
  24. public static function fieldRelations(): array
  25. {
  26. return [
  27. "sender_email" => "mail.from.address",
  28. "sender" => "mail.from.name",
  29. "domain" => "mail.mailers.smtp.url",
  30. "smtp_server" => "mail.mailers.smtp.host",
  31. "smtp_account" => "mail.mailers.smtp.username",
  32. "smtp_port" => "mail.mailers.smtp.port",
  33. "encryption" => "mail.mailers.smtp.encryption",
  34. "smtp_password" => "mail.mailers.smtp.password",
  35. ];
  36. }
  37. }