tinkerwell
This commit is contained in:
		
							
								
								
									
										27
									
								
								.tinkerwell/snippets/SendEmail.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								.tinkerwell/snippets/SendEmail.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
<?php
 | 
			
		||||
/**
 | 
			
		||||
 * @label Send Email
 | 
			
		||||
 * @description Send email to all users
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
use Illuminate\Notifications\Messages\MailMessage;
 | 
			
		||||
 | 
			
		||||
set_transanctional_email_settings();
 | 
			
		||||
 | 
			
		||||
$users = User::all();
 | 
			
		||||
foreach ($users as $user) {
 | 
			
		||||
  Mail::send([], [], function ($message) use ($user) {
 | 
			
		||||
    $message
 | 
			
		||||
      ->to($user->email)
 | 
			
		||||
      ->subject("Testing")
 | 
			
		||||
      ->text(
 | 
			
		||||
        <<<EOF
 | 
			
		||||
Hello,
 | 
			
		||||
 | 
			
		||||
Welcome to Coolify Cloud.
 | 
			
		||||
Here is your user id: $user->id
 | 
			
		||||
 | 
			
		||||
EOF
 | 
			
		||||
      );
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user