Bladeren bron

Display domain's default recipient on aliases page

Will Browning 5 jaren geleden
bovenliggende
commit
54c95626fd
3 gewijzigde bestanden met toevoegingen van 11 en 3 verwijderingen
  1. 1 1
      README.md
  2. 1 1
      app/Http/Controllers/AliasController.php
  3. 9 1
      resources/js/pages/Aliases.vue

+ 1 - 1
README.md

@@ -160,7 +160,7 @@ If you get close to your limit you'll be sent an email letting you know. If you
 
 Please make sure to add mailer@anonaddy.me to your address book and check your spam folder. Make sure to mark emails from us as safe if they turn up in spam.
 
-Please also check that the senders domain is not in the [disposable-email-domains](https://github.com/ivolo/disposable-email-domains) list mentioned above, as these are blocked.
+Please also check that the sender's domain is not in the [disposable-email-domains](https://github.com/ivolo/disposable-email-domains) list mentioned above, as these are blocked.
 
 If an alias has been previously deleted and you try to send email to it, the emails will bounce with an error message - "554 5.7.1 Recipient address rejected: Access denied".
 

+ 1 - 1
app/Http/Controllers/AliasController.php

@@ -13,7 +13,7 @@ class AliasController extends Controller
     {
         return view('aliases.index', [
             'defaultRecipient' => user()->defaultRecipient,
-            'aliases' => user()->aliases()->with('recipients')->latest()->get(),
+            'aliases' => user()->aliases()->with(['recipients', 'customDomain.defaultRecipient'])->latest()->get(),
             'recipients' => user()->verifiedRecipients,
             'totalForwarded' => user()->totalEmailsForwarded(),
             'totalBlocked' => user()->totalEmailsBlocked(),

+ 9 - 1
resources/js/pages/Aliases.vue

@@ -233,6 +233,12 @@
           <span v-else-if="props.row.id === recipientsAliasToEdit.id">{{
             aliasRecipientsToEdit.length ? aliasRecipientsToEdit.length : '1'
           }}</span>
+          <span
+            v-else-if="has(props.row.custom_domain, 'default_recipient.email')"
+            class="py-1 px-2 text-sm bg-yellow-200 text-yellow-900 rounded-full tooltip outline-none"
+            :data-tippy-content="props.row.custom_domain.default_recipient.email"
+            >domain's default</span
+          >
           <span
             v-else
             class="py-1 px-2 text-sm bg-yellow-200 text-yellow-900 rounded-full tooltip outline-none"
@@ -802,10 +808,12 @@ export default {
     sortRecipients(x, y) {
       return x.length < y.length ? -1 : x.length > y.length ? 1 : 0
     },
+    has(object, path) {
+      return _.has(object, path)
+    },
     clipboardSuccess() {
       this.success('Copied to clipboard')
     },
-
     clipboardError() {
       this.error('Could not copy to clipboard')
     },