Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

Message.php 1.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. namespace Grav\Plugin\Email;
  3. use Symfony\Component\Mime\Email as SymfonyEmail;
  4. class Message
  5. {
  6. /** @var SymfonyEmail */
  7. protected $email;
  8. public function __construct() {
  9. $this->email = new SymfonyEmail();
  10. }
  11. public function subject($subject): self
  12. {
  13. $this->email->subject($subject);
  14. return $this;
  15. }
  16. public function setSubject($subject): self
  17. {
  18. $this->subject($subject);
  19. return $this;
  20. }
  21. public function to($to): self
  22. {
  23. $this->email->to($to);
  24. return $this;
  25. }
  26. public function from($from): self
  27. {
  28. $this->email->from($from);
  29. return $this;
  30. }
  31. public function cc($cc): self
  32. {
  33. $this->email->cc($cc);
  34. return $this;
  35. }
  36. public function bcc($bcc): self
  37. {
  38. $this->email->bcc($bcc);
  39. return $this;
  40. }
  41. public function replyTo($reply_to): self
  42. {
  43. $this->email->replyTo($reply_to);
  44. return $this;
  45. }
  46. public function text($text): self
  47. {
  48. $this->email->text($text);
  49. return $this;
  50. }
  51. public function html($html): self
  52. {
  53. $this->email->html($html);
  54. return $this;
  55. }
  56. public function attachFromPath($path): self
  57. {
  58. $this->email->attachFromPath($path);
  59. return $this;
  60. }
  61. public function embedFromPath($path): self
  62. {
  63. $this->email->embedFromPath($path);
  64. return $this;
  65. }
  66. public function reply_to($reply_to): self
  67. {
  68. $this->replyTo($reply_to);
  69. return $this;
  70. }
  71. public function setFrom($from): self
  72. {
  73. $this->from($from);
  74. return $this;
  75. }
  76. public function setTo($to): self
  77. {
  78. $this->to($to);
  79. return $this;
  80. }
  81. public function getEmail(): SymfonyEmail
  82. {
  83. return $this->email;
  84. }
  85. }