public function email($emailAddress){
$data = array(
'email' => $emailAddress,
'name' => 'Test Name'
);
$result = Mail::queue('emails.test', $data, function ($message) use ($data){
$message->from(Config::get('settings.contact_form_from.address'), Config::get('settings.contact_form_from.name'));
$message->sender(Config::get('settings.contact_form_from.address'), Config::get('settings.contact_form_from.name'));
$message->to($data['email'], $data['name']);
$message->subject('Test email to: ' . $data['email']);
});
return $this->response($result);
}
This is using the queue
function. If adjusted to Mail::send()
also work's fine. Thus all my queue handlers and mail env variables are working fine. (I can see both these emails in Mandrill).So my issue is the the password reset functionality which I have installed using the Laravel 5.2 Auth Scaffolding.
So, the route etc all works fine - just no email sends.
It correctly identifies if the user does/doesn't exist (displays the correct error message).
So then I have a look through source code and got slightly lost, help is needed!
If i look in here...
...Illuminate\Foundation\Auth\ResetPasswords.php
I can see this method.public function sendResetLinkEmail(Request $request) { $this->validateSendResetLinkEmail($request);
$broker = $this->getBroker();
$response = Password::broker($broker)->sendResetLink(
$this->getSendResetLinkEmailCredentials($request),
$this->resetEmailBuilder()
);
switch ($response) {
case Password::RESET_LINK_SENT:
return $this->getSendResetLinkEmailSuccessResponse($response);
case Password::INVALID_USER:
default:
return $this->getSendResetLinkEmailFailureResponse($response);
}
}If I break at
$response
I am getting response that it is sent correctly. So I assume it is something to do with Password::broker
section, the code here completely looses me.Any help much appreciated!
via Matt The Ninja