Skip to content

Commit

Permalink
fix: add missing methods from docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Nov 29, 2024
1 parent 6e51cda commit e41d285
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ public function __construct($mail = null)
$this->mail = $mail;
}

/**
* Connect to your mail server
*
* @param array $connection Connection details
*/
public function connect($connection)
{
Mailer::connect($connection);
}

/**
* Create a new mail instance
*
* @param mixed $mail
* @return static
*/
public static function create($mail)
{
return new static($mail);
Expand All @@ -41,7 +57,7 @@ public function getMail()

/**
* Add attachments to your mail from your file system
*
*
* @throws Exception
* @return Mail
*/
Expand Down
8 changes: 8 additions & 0 deletions src/Mail/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ public static function connect($connection)
} else {
static::$mailer->SMTPSecure = $connection['security'];
}

if (isset($connection['defaults'])) {
static::$config['defaults'] = $connection['defaults'];
}

if (isset($connection['debug'])) {
static::$config['debug'] = $connection['debug'];
}
}

public static function config($config = [])
Expand Down

0 comments on commit e41d285

Please sign in to comment.