控制台应用,yzncms本身基于tp5.1框架,里面的队列用不了,bug,坑
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Yzncms [ 御宅男工作室 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2018 http://yzncms.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 御宅男 <530765310@qq.com>
  10. // +----------------------------------------------------------------------
  11. // +----------------------------------------------------------------------
  12. // | 邮件插件
  13. // +----------------------------------------------------------------------
  14. namespace addons\saiyouems;
  15. use addons\saiyouems\lib\Ems;
  16. use think\Addons;
  17. class Saiyouems extends Addons
  18. {
  19. //安装
  20. public function install()
  21. {
  22. return true;
  23. }
  24. //卸载
  25. public function uninstall()
  26. {
  27. return true;
  28. }
  29. /**
  30. * 邮箱发送行为
  31. * @param Sms $params
  32. * @return boolean
  33. */
  34. public function emsSend($params)
  35. {
  36. $ems = new Ems();
  37. $result = $ems->email($params['email'])->subject('邮件验证')->text("你的邮件验证码是:{$params['code']}")->send();
  38. return $result;
  39. }
  40. /**
  41. * 邮箱发送通知
  42. * @param array $params
  43. * @return boolean
  44. */
  45. public function emsNotice($params)
  46. {
  47. $ems = new Ems();
  48. $result = $ems->email($params['email'])->subject($params['title'])->text($params['msg'])->send();
  49. return $result;
  50. }
  51. /**
  52. * 检测验证是否正确
  53. * @param Sms $params
  54. * @return boolean
  55. */
  56. public function emsCheck($params)
  57. {
  58. return true;
  59. }
  60. }