Skip to content

Commit

Permalink
Fix projectDirectory and USERBUNDLE_FROM_EMAILADDRESS
Browse files Browse the repository at this point in the history
  • Loading branch information
reyostallenberg committed Oct 3, 2019
1 parent b3d57d4 commit c13e2b7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ This bundle will be extendible and provide:
- Recover password functionality
- Being API accessable
- Ability to 'switch on' OAuth (Google/GitHub/Facebook/etc)

## Environment

Set the environment variables to be able to send e-mails.

```dotenv
USERBUNDLE_FROM_EMAILADDRESS=example@example.com
```
14 changes: 4 additions & 10 deletions src/Mailer/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,11 @@ class Mailer
*/
private $twig;

/**
* @var string
*/
private $projectDirectory;

public function __construct(\Swift_Mailer $mailer, string $fromEmail, Environment $twig, string $projectDirectory)
public function __construct(\Swift_Mailer $mailer, string $fromEmail, Environment $twig)
{
$this->mailer = $mailer;
$this->fromEmail = $fromEmail;
$this->twig = $twig;
$this->projectDirectory = $projectDirectory;
$this->mailer = $mailer;
$this->fromEmail = $fromEmail;
$this->twig = $twig;
}

public function createMessageAndSend(string $name, $to, array $parameters = []): \Swift_Message
Expand Down
1 change: 0 additions & 1 deletion src/Resources/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ services:
- '@mailer'
- '%env(USERBUNDLE_FROM_EMAILADDRESS)%'
- '@twig'
- '%kernel.project_dir%'

ConnectHolland\UserBundle\Mailer\RegistrationEmail:
arguments:
Expand Down

0 comments on commit c13e2b7

Please sign in to comment.