Skip to content

Latest commit

 

History

History
76 lines (56 loc) · 1.41 KB

README.md

File metadata and controls

76 lines (56 loc) · 1.41 KB

Kappa\Mail

Package for more comfortable works with Nette\Mail\Message

Requirements:

Installation:

The best way to install Kappa\Mail is using Composer

$ composer require kappa/mail:@dev

Usages

Register extension:

extensions:
	messages: Kappa\Mail\DI\MailExtension

In config file you can define messages

messages:
	messageName:
		option: value
		options:
			- value

Message options corresponds with API Nette\Mail\Massage class

Actual options:

  • from - string
  • subject - string
  • returnPath - string
  • priority - integer
  • replyTo - array
  • to - array
  • cc array
  • bcc - array
  • embeddedFile - array
  • attachment - array

Example usage

In your code:

class Model
{
	private $messageFactory;

	public function __construct(\Kappa\Mail\MessageFactory $messageFactory)
	{
		$this->messageFactory = $messageFactory;
	}

	public function sendMail(array $data)
	{
		$message = $this->messageFactory->createMessage('messageName', 'email_template.latte', $data);
		//...
	}
}