-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
28 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,11 @@ | |
// -------- services -------- | ||
|
||
use Illuminate\Support\Facades\Mail; | ||
use Illuminate\Support\Facades\Notification; | ||
use Modules\Notify\Emails\BeautyEmail; | ||
use Modules\Notify\Notifications\Notify; | ||
use Modules\Theme\Services\ThemeService; | ||
use Illuminate\Support\Facades\Notification; | ||
use Modules\Notify\Notifications\TestNotification; | ||
use Modules\Theme\Services\ThemeService; | ||
use Modules\Xot\Models\Panels\Actions\XotBasePanelAction; | ||
|
||
// -------- bases ----------- | ||
|
@@ -39,13 +39,16 @@ public function handle() { | |
'minty' => 'minty', | ||
'sunny' => 'sunny', | ||
]; | ||
$mailer_options = array_keys(config('mail.mailers')); | ||
$mailer_options = array_combine($mailer_options, $mailer_options); | ||
|
||
$view = ThemeService::getView(); | ||
|
||
$view_params = [ | ||
'view' => $view, | ||
'options' => $options, | ||
'template_options'=>$template_options, | ||
'template_options' => $template_options, | ||
'mailer_options' => $mailer_options, | ||
]; | ||
|
||
return view()->make($view, $view_params); | ||
|
@@ -56,23 +59,25 @@ public function handle() { | |
*/ | ||
public function postHandle() { | ||
$data = request()->all(); | ||
//$options['ssl'] = array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true); | ||
//dddx($data); | ||
/* | ||
// $options['ssl'] = array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true); | ||
// dddx($data); | ||
// * | ||
try { | ||
Mail::raw($data['body'], function ($msg) use ($data) { | ||
Mail::mailer($data['mailer'])->raw($data['body'], function ($msg) use ($data) { | ||
$msg->to($data['to'])->subject($data['subject']); | ||
}); | ||
} catch (ErrorException $e) { | ||
throw new Exception('['.__LINE__.']['.__FILE__.']'); | ||
} | ||
*/ | ||
//$view='notify::emails.welcome'; | ||
$view='notify::emails.samples.ark'; | ||
$test=(object)['a'=>'b']; | ||
$users=[ | ||
//new Notify('mail',['[email protected]','[email protected]']), | ||
new Notify('mail','[email protected]'), | ||
|
||
return 'done'; | ||
// */ | ||
// $view='notify::emails.welcome'; | ||
$view = 'notify::emails.samples.ark'; | ||
$test = (object) ['a' => 'b']; | ||
$users = [ | ||
// new Notify('mail',['[email protected]','[email protected]']), | ||
new Notify('mail', '[email protected]'), | ||
]; | ||
|
||
Notification::send($users, new TestNotification($test)); | ||
|
@@ -82,21 +87,17 @@ public function postHandle() { | |
return view($view,$view_params); | ||
$beautymail->send($view, [], | ||
$beautymail->send($view, [], | ||
function(\Illuminate\Mail\Message $message) use($data){ | ||
$res=$message | ||
//->from($data['from']) | ||
->to($data['to']) | ||
->subject($data['subject']); | ||
} | ||
$res=$message | ||
//->from($data['from']) | ||
->to($data['to']) | ||
->subject($data['subject']); | ||
} | ||
); | ||
*/ | ||
//*/ | ||
|
||
|
||
|
||
// */ | ||
|
||
echo '<h3>Done</h3>'; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters