Skip to content

Commit e41d285

Browse files
committed
fix: add missing methods from docs
1 parent 6e51cda commit e41d285

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/Mail.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,22 @@ public function __construct($mail = null)
1515
$this->mail = $mail;
1616
}
1717

18+
/**
19+
* Connect to your mail server
20+
*
21+
* @param array $connection Connection details
22+
*/
23+
public function connect($connection)
24+
{
25+
Mailer::connect($connection);
26+
}
27+
28+
/**
29+
* Create a new mail instance
30+
*
31+
* @param mixed $mail
32+
* @return static
33+
*/
1834
public static function create($mail)
1935
{
2036
return new static($mail);
@@ -41,7 +57,7 @@ public function getMail()
4157

4258
/**
4359
* Add attachments to your mail from your file system
44-
*
60+
*
4561
* @throws Exception
4662
* @return Mail
4763
*/

src/Mail/Mailer.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ public static function connect($connection)
7777
} else {
7878
static::$mailer->SMTPSecure = $connection['security'];
7979
}
80+
81+
if (isset($connection['defaults'])) {
82+
static::$config['defaults'] = $connection['defaults'];
83+
}
84+
85+
if (isset($connection['debug'])) {
86+
static::$config['debug'] = $connection['debug'];
87+
}
8088
}
8189

8290
public static function config($config = [])

0 commit comments

Comments
 (0)