twin-elements / message
Helper in composing the message
v1.3.2
2022-07-29 11:20 UTC
Requires
- php: ^7.1 || ^8.0
- symfony/dependency-injection: ^4.4 || ^5.4
- symfony/mime: ^4.4 || ^5.4
- symfony/twig-bridge: ^4.4 || ^5.4
README
##Installation
###Step 1: Download the Bundle
composer require twin-elements/message
###Step 2: If you do not use TwinElements/AdminBundle, enable the service
#config/services.yaml
services:
TwinElements\Component\Message\MessageBuilderFactory: ~
###Usage
public function index(
MessageBuilderFactory $messageBuilderFactory,
MailerInterface $mailer
)
{
$message = ($messageBuilderFactory->createMessageBuilder()->getMessage(
'Subject',
['key' => 'value'],
'email_template_path.html.twig'
))
->addTo('email@email.com');
$mailer->send($message);
}