Skip to content

Commit 328b737

Browse files
Vinicius de Almeida ArantesVinicius de Almeida Arantes
authored andcommitted
Update EmailDelivery
Allow mailer to be configurable matching all other flows like user validation and password resert in the OneTimeLogin flow
1 parent 6085781 commit 328b737

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Model/Behavior/OneTimeDelivery/EmailDelivery.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace CakeDC\Users\Model\Behavior\OneTimeDelivery;
55

6+
use Cake\Core\Configure;
67
use Cake\Datasource\EntityInterface;
78
use Cake\Mailer\MailerAwareTrait;
89

@@ -37,6 +38,8 @@ public function __construct(array $options = [])
3738
*/
3839
public function send(EntityInterface $user, string $token): void
3940
{
40-
$this->getMailer('CakeDC/Users.Users')->send('sendToken', [$user, $token]);
41+
$this
42+
->getMailer(Configure::read('Users.Email.mailerClass') ?: 'CakeDC/Users.Users')
43+
->send('sendToken', [$user, $token]);
4144
}
4245
}

0 commit comments

Comments
 (0)