mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 22:19:41 -08:00
Fixes #4011 - do not send email to user on license checkout
This commit is contained in:
parent
7fe2a1f802
commit
faf3802971
|
@ -279,7 +279,7 @@ class LicensesController extends Controller
|
||||||
|
|
||||||
// Declare the rules for the form validation
|
// Declare the rules for the form validation
|
||||||
$rules = [
|
$rules = [
|
||||||
'note' => 'string',
|
'note' => 'string|nullable',
|
||||||
'asset_id' => 'required_without:assigned_to',
|
'asset_id' => 'required_without:assigned_to',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,9 @@ class CheckoutNotification extends Notification
|
||||||
}
|
}
|
||||||
$item = $this->params['item'];
|
$item = $this->params['item'];
|
||||||
|
|
||||||
|
if (class_basename(get_class($this->params['item']))!='License') {
|
||||||
$notifyBy[] = 'mail';
|
$notifyBy[] = 'mail';
|
||||||
|
}
|
||||||
// if ((method_exists($item, 'requireAcceptance') && ($item->requireAcceptance()=='1'))
|
// if ((method_exists($item, 'requireAcceptance') && ($item->requireAcceptance()=='1'))
|
||||||
// || (method_exists($item, 'getEula') && ($item->getEula()))
|
// || (method_exists($item, 'getEula') && ($item->getEula()))
|
||||||
// ) {
|
// ) {
|
||||||
|
@ -81,6 +83,7 @@ class CheckoutNotification extends Notification
|
||||||
*/
|
*/
|
||||||
public function toMail($notifiable)
|
public function toMail($notifiable)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: Expand for non assets.
|
//TODO: Expand for non assets.
|
||||||
$item = $this->params['item'];
|
$item = $this->params['item'];
|
||||||
$admin_user = $this->params['admin'];
|
$admin_user = $this->params['admin'];
|
||||||
|
@ -97,14 +100,14 @@ class CheckoutNotification extends Notification
|
||||||
'require_acceptance' => method_exists($item, 'requireAcceptance') ? $item->requireAcceptance() : '',
|
'require_acceptance' => method_exists($item, 'requireAcceptance') ? $item->requireAcceptance() : '',
|
||||||
'log_id' => $this->params['log_id'],
|
'log_id' => $this->params['log_id'],
|
||||||
];
|
];
|
||||||
|
|
||||||
return (new MailMessage)
|
return (new MailMessage)
|
||||||
->view('emails.accept-asset', $data)
|
->view('emails.accept-asset', $data)
|
||||||
->subject(trans('mail.Confirm_asset_delivery'));
|
->subject(trans('mail.Confirm_asset_delivery'));
|
||||||
// \Mail::send('emails.accept-asset', $data, function ($m) use ($target) {
|
|
||||||
// $m->to($target->email, $target->first_name . ' ' . $target->last_name);
|
|
||||||
// $m->replyTo(config('mail.reply_to.address'), config('mail.reply_to.name'));
|
|
||||||
// $m->subject(trans('mail.Confirm_asset_delivery'));
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue