Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nowisesys/uup-mail
Mail template and composing library for PHP
https://github.com/nowisesys/uup-mail
compose mail php-library
Last synced: 1 day ago
JSON representation
Mail template and composing library for PHP
- Host: GitHub
- URL: https://github.com/nowisesys/uup-mail
- Owner: nowisesys
- License: apache-2.0
- Created: 2019-01-23T23:21:31.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-15T03:00:17.000Z (about 5 years ago)
- Last Synced: 2024-04-22T00:20:20.824Z (7 months ago)
- Topics: compose, mail, php-library
- Language: PHP
- Size: 60.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## UUP-MAIL - Mail template and composing library for PHP
The uup-mail library provides a mail template and composer library for formatting
mail messages. Its main focus is on MIME message composition and layout using templates.
The actual sending (transport) of the SMTP message is delegated to other libraries,
currently Swift Mailer, PEAR Mail or PHPMailer is supported.### Design
This library was designed with inheritance in mind. Create your own mail message
classes (one for each particular kind of message) derived from class MessageComposer:```php
class ConfirmSubscriptionMessage extends MessageComposer
{
public function __construct()
{
parent::__construct(_("Confirm Subscription", _("...")));
// ... create additional section headers with content.
}public function setSubscription($id)
{
parent::setContent('Subscription', Subscription::get($id));
}
}$composer = new ConfirmSubscriptionMessage();
$message = new SwiftMessage($composer, $formatter);
$mailer->send($message);
```### Usage
The library can be used at three different levels:
1. Use UUP\Mail\Compose only. The library is used solely for message composition.
2. Use i.e. UUP\Mail\Swift. This is the intermediate level were you can take
advantage of the message composition and layout, while still have native
access to the Swift Mailer library too.3. Use UUP\Mail and its interface. The programming at this level is done against
the interfaces (Message and MessageMailer) using the MessageService as a proxy
against your code and the native implementation, i.e. Swift Mailer.A good example of real world usage can be found in example/realistic.php
### More
More information can be found on the [project page](https://nowise.se/oss/uup/mail)