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