fix: help should send cc on email
This commit is contained in:
		@@ -41,7 +41,7 @@ class Help extends Component
 | 
				
			|||||||
                ]
 | 
					                ]
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
            $mail->subject("[HELP - {$subscriptionType}]: {$this->subject}");
 | 
					            $mail->subject("[HELP - {$subscriptionType}]: {$this->subject}");
 | 
				
			||||||
            send_user_an_email($mail, 'hi@coollabs.io');
 | 
					            send_user_an_email($mail, 'hi@coollabs.io', auth()->user()?->email);
 | 
				
			||||||
            $this->emit('success', 'Your message has been sent successfully. We will get in touch with you as soon as possible.');
 | 
					            $this->emit('success', 'Your message has been sent successfully. We will get in touch with you as soon as possible.');
 | 
				
			||||||
        } catch (\Throwable $e) {
 | 
					        } catch (\Throwable $e) {
 | 
				
			||||||
            return general_error_handler($e, $this);
 | 
					            return general_error_handler($e, $this);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -262,21 +262,33 @@ function send_internal_notification(string $message): void
 | 
				
			|||||||
        ray($e->getMessage());
 | 
					        ray($e->getMessage());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
function send_user_an_email(MailMessage $mail, string $email): void
 | 
					function send_user_an_email(MailMessage $mail, string $email, ?string $cc = null): void
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    $settings = InstanceSettings::get();
 | 
					    $settings = InstanceSettings::get();
 | 
				
			||||||
    $type = set_transanctional_email_settings($settings);
 | 
					    $type = set_transanctional_email_settings($settings);
 | 
				
			||||||
    if (!$type) {
 | 
					    if (!$type) {
 | 
				
			||||||
        throw new Exception('No email settings found.');
 | 
					        throw new Exception('No email settings found.');
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    Mail::send(
 | 
					    if ($cc) {
 | 
				
			||||||
        [],
 | 
					        Mail::send(
 | 
				
			||||||
        [],
 | 
					            [],
 | 
				
			||||||
        fn (Message $message) => $message
 | 
					            [],
 | 
				
			||||||
            ->to($email)
 | 
					            fn (Message $message) => $message
 | 
				
			||||||
            ->subject($mail->subject)
 | 
					                ->to($email)
 | 
				
			||||||
            ->html((string) $mail->render())
 | 
					                ->cc($cc)
 | 
				
			||||||
    );
 | 
					                ->subject($mail->subject)
 | 
				
			||||||
 | 
					                ->html((string) $mail->render())
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					        Mail::send(
 | 
				
			||||||
 | 
					            [],
 | 
				
			||||||
 | 
					            [],
 | 
				
			||||||
 | 
					            fn (Message $message) => $message
 | 
				
			||||||
 | 
					                ->to($email)
 | 
				
			||||||
 | 
					                ->subject($mail->subject)
 | 
				
			||||||
 | 
					                ->html((string) $mail->render())
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
function isEmailEnabled($notifiable)
 | 
					function isEmailEnabled($notifiable)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,6 +10,18 @@
 | 
				
			|||||||
                    </svg>
 | 
					                    </svg>
 | 
				
			||||||
                </a>
 | 
					                </a>
 | 
				
			||||||
            </li>
 | 
					            </li>
 | 
				
			||||||
 | 
					            <li title="Help" class="mt-auto">
 | 
				
			||||||
 | 
					                <div class="justify-center icons" wire:click="help" onclick="help.showModal()">
 | 
				
			||||||
 | 
					                    <svg class="{{ request()->is('help*') ? 'text-warning icon' : 'icon' }}" viewBox="0 0 24 24"
 | 
				
			||||||
 | 
					                        xmlns="http://www.w3.org/2000/svg">
 | 
				
			||||||
 | 
					                        <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
 | 
				
			||||||
 | 
					                            stroke-width="2">
 | 
				
			||||||
 | 
					                            <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0m9 4v.01" />
 | 
				
			||||||
 | 
					                            <path d="M12 13a2 2 0 0 0 .914-3.782a1.98 1.98 0 0 0-2.414.483" />
 | 
				
			||||||
 | 
					                        </g>
 | 
				
			||||||
 | 
					                    </svg>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					            </li>
 | 
				
			||||||
            <li class="pb-6" title="Logout">
 | 
					            <li class="pb-6" title="Logout">
 | 
				
			||||||
                <form action="/logout" method="POST" class=" hover:bg-transparent">
 | 
					                <form action="/logout" method="POST" class=" hover:bg-transparent">
 | 
				
			||||||
                    @csrf
 | 
					                    @csrf
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user