Skip to content

Commit

Permalink
readme usage
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosdipaoloSV committed Jan 29, 2021
1 parent fd0221c commit ab95552
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Mailer
## A PHP Mailer library
Mailer is a super simple mail package wrapping the Symfony `SwiftMailer`
### Dependencies
This package -as a standalone- has a dependency that has to be manually installed. This of course applies if your app doesn't already have it installed.

Expand All @@ -19,3 +20,17 @@ MAIL_PASSWORD
MAIL_PORT
MAIL_ENCRYPTION
```
### Usage
With the helper `mailer()` which is the same as `new MDP\Mailer`
```php
mailer()->send($subject, $mailFrom, $nameFrom, $recipients, $body);
```
You can add as a sixth parameter the **priority** as an integer, being `1` the highest and `5` the lowest.
This can be achieved also using the swiftmailer constants:
```php
Swift_Mime_SimpleMessage::PRIORITY_HIGHEST; // 1
Swift_Mime_SimpleMessage::PRIORITY_HIGH; // 2
Swift_Mime_SimpleMessage::PRIORITY_NORMAL; // 3
Swift_Mime_SimpleMessage::PRIORITY_LOW; // 4
Swift_Mime_SimpleMessage::PRIORITY_LOWEST; // 5
```

0 comments on commit ab95552

Please sign in to comment.