Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
marco76tv authored and Malebestia committed Sep 4, 2023
1 parent 6442937 commit 7510a9e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
51 changes: 26 additions & 25 deletions Models/Panels/Actions/TrySendMailAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 -----------
Expand All @@ -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);
Expand All @@ -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));
Expand All @@ -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>';
}
}

2 changes: 2 additions & 0 deletions Resources/views/admin/home/acts/try_send_mail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
--}}
<x-input.group type="select" name="template" :options="$template_options"/>

<x-input.group type="select" name="mailer" :options="$mailer_options"/>

<button class="btn btn-primary" type="submit">go!</button>

</form>
Expand Down

0 comments on commit 7510a9e

Please sign in to comment.