Browse Source

Disable Discord/Email Credit Messages if not set

This is a quick and dirty way I suppose? But it works and makes Companys that dont give away free servers not look that dumb
Dennis 3 years ago
parent
commit
c8c8ae753d
1 changed files with 25 additions and 1 deletions
  1. 25 1
      app/Notifications/WelcomeMessage.php

+ 25 - 1
app/Notifications/WelcomeMessage.php

@@ -38,6 +38,8 @@ class WelcomeMessage extends Notification implements ShouldQueue
         return ['database'];
         return ['database'];
     }
     }
 
 
+    
+
     /**
     /**
      * Get the array representation of the notification.
      * Get the array representation of the notification.
      *
      *
@@ -46,12 +48,34 @@ class WelcomeMessage extends Notification implements ShouldQueue
      */
      */
     public function toArray($notifiable)
     public function toArray($notifiable)
     {
     {
+        function AdditionalLines() 
+        {
+            $AdditionalLine = "";
+            if(Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_EMAIL') != 0) {
+                $AdditionalLine .= "Verifying your E-Mail Adress will grant you ".Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_EMAIL')." additional Credits <br />";
+            }
+            if(Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') != 0) {
+                $AdditionalLine .= "Verifying your Mail will also increase your Server Limit by " . Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') . " <br />";
+            }
+                $AdditionalLine .="<br />";
+            if(Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_DISCORD') != 0) {
+                $AdditionalLine .=  "You can also verify your discord account to get another " . Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_DISCORD') . " credits <br />";
+            }
+            if(Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') != 0) {
+                $AdditionalLine .=  "Verifying Discord will also increase your Server Limit by " . Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') . " <br />";
+            }
+
+            return $AdditionalLine;
+        }
+        
         return [
         return [
             'title'   => "Getting started!",
             'title'   => "Getting started!",
             'content' => "
             'content' => "
                <p>Hello <strong>{$this->user->name}</strong>, Welcome to our dashboard!</p>
                <p>Hello <strong>{$this->user->name}</strong>, Welcome to our dashboard!</p>
                 <h5>Verification</h5>
                 <h5>Verification</h5>
-                <p>Please verify your email address to get " . Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_EMAIL') . " extra credits and increase your server limit to " . Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') . "<br />You can also verify your discord account to get another " . Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_DISCORD') . " credits and to increase your server limit again with " . Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') . "</p>
+                <p>Please remember that you can verify your E-Mail Adress and Link/Verify your Discord-Account
+                    ".AdditionalLines()."
+                </p>
                 <h5>Information</h5>
                 <h5>Information</h5>
                 <p>This dashboard can be used to create and delete servers.<br /> These servers can be used and managed on our pterodactyl panel.<br /> If you have any questions, please join our Discord server and #create-a-ticket.</p>
                 <p>This dashboard can be used to create and delete servers.<br /> These servers can be used and managed on our pterodactyl panel.<br /> If you have any questions, please join our Discord server and #create-a-ticket.</p>
                 <p>We hope you can enjoy this hosting experience and if you have any suggestions please let us know!</p>
                 <p>We hope you can enjoy this hosting experience and if you have any suggestions please let us know!</p>