Pass SubscriberEntity to sendConfirmationEmail() and sendConfirmationEmailOnce()

This commit changes the methods sendConfirmationEmail() and
sendConfirmationEmailOnce() to accept as the first parameter an instance
of SubscriberEntity instead of the old model Subscriber. It also updates
all the places where those two methods are called.

[MAILPOET-3815]
This commit is contained in:
Rodrigo Primo
2021-12-01 20:25:36 -03:00
committed by Veljko V
parent 8cd3205ade
commit 6c05b3eaf0
9 changed files with 153 additions and 106 deletions

View File

@ -197,8 +197,8 @@ class Subscribers extends APIEndpoint {
public function sendConfirmationEmail($data = []) {
$id = (isset($data['id']) ? (int)$data['id'] : false);
$subscriber = Subscriber::findOne($id);
if ($subscriber instanceof Subscriber) {
$subscriber = $this->subscribersRepository->findOneById($id);
if ($subscriber instanceof SubscriberEntity) {
if ($this->confirmationEmailMailer->sendConfirmationEmail($subscriber)) {
return $this->successResponse();
}