-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
a461ecc
commit c2f0482
Showing
6 changed files
with
141 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -259,7 +259,6 @@ public function asNodeTasks(): array | |
'payload' => [ | ||
'caddy' => $caddy, | ||
], | ||
|
||
]; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
namespace App\Notifications; | ||
|
||
use App\Models\Team; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Notifications\Messages\MailMessage; | ||
use Illuminate\Notifications\Notification; | ||
|
||
class AskFinalTrialFeedback extends Notification implements ShouldQueue | ||
{ | ||
use Queueable; | ||
|
||
public function __construct( | ||
protected Team $team | ||
) { | ||
$this->afterCommit(); | ||
} | ||
|
||
public function shouldSend(object $notifiable, string $channel): bool | ||
{ | ||
return $this->team->onTrial(); | ||
} | ||
|
||
public function via(object $notifiable): array | ||
{ | ||
return ['mail']; | ||
} | ||
|
||
public function toMail(object $notifiable): MailMessage | ||
{ | ||
$trialEndsAt = $this->team->trialEndsAt(); | ||
$dateDiff = $trialEndsAt->longRelativeToNowDiffForHumans(); | ||
|
||
return (new MailMessage) | ||
->subject("Your Ptah.sh trial ends soon - We'd love your final feedback") | ||
->greeting("Hello {$this->team->owner->name}!") | ||
->line("Your Ptah.sh trial for team {$this->team->name} is ending soon.") | ||
->line("You will not be able to use Ptah.sh after {$trialEndsAt->toDateTimeString()} ({$dateDiff}).") | ||
->line('Before your trial ends, we\'d greatly appreciate your final thoughts.') | ||
->line('Your feedback is crucial in helping us improve Ptah.sh for you and future users.') | ||
->line('Please reply to this email with your experience and any suggestions you might have.') | ||
->line('Thank you for trying Ptah.sh. We hope you\'ve found it valuable!') | ||
->line('If you\'re interested in continuing with Ptah.sh, please visit our pricing page to choose a plan that suits your needs.') | ||
->action('Choose a Plan', route('teams.billing.show', $this->team)) | ||
->line('If you have any questions or need assistance, don\'t hesitate to reach out at '.config('app.email').'.'); | ||
} | ||
|
||
public function toArray(object $notifiable): array | ||
{ | ||
return [ | ||
// | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
|
||
namespace App\Notifications; | ||
|
||
use App\Models\Team; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Notifications\Messages\MailMessage; | ||
use Illuminate\Notifications\Notification; | ||
|
||
class AskMidTrialFeedback extends Notification implements ShouldQueue | ||
{ | ||
use Queueable; | ||
|
||
/** | ||
* Create a new notification instance. | ||
*/ | ||
public function __construct( | ||
protected Team $team | ||
) { | ||
$this->afterCommit(); | ||
} | ||
|
||
/** | ||
* Get the notification's delivery channels. | ||
* | ||
* @return array<int, string> | ||
*/ | ||
public function via(object $notifiable): array | ||
{ | ||
return ['mail']; | ||
} | ||
|
||
/** | ||
* Get the mail representation of the notification. | ||
*/ | ||
public function toMail(object $notifiable): MailMessage | ||
{ | ||
$nodeCount = $this->team->nodes()->count(); | ||
$serviceCount = $this->team->services()->count(); | ||
|
||
$message = (new MailMessage) | ||
->subject('We\'d love your feedback on Ptah.sh') | ||
->greeting("Hello {$this->team->owner->name}!") | ||
->line('We hope you\'re enjoying your experience with Ptah.sh so far.') | ||
->line('We\'d love to hear your thoughts and improve our service based on your feedback.') | ||
->line('Simply reply to this email with your feedback - we\'re eager to hear from you!'); | ||
|
||
if ($nodeCount === 0) { | ||
$message->line('We noticed you don\'t have any active nodes at the moment. We\'d love to know if there\'s anything holding you back or if you need any assistance getting started or restarting with nodes.'); | ||
} elseif ($serviceCount === 1) { | ||
$message->line('We see you haven\'t created any custom services yet. How has your experience been so far? Is there anything we can do to make it easier for you to create and manage services?'); | ||
} elseif ($serviceCount === 2) { | ||
$message->line('We see you\'ve created your first custom service. How was your experience? Is there anything we can do to make it easier for you to manage or create more services?'); | ||
} else { | ||
$message->line('It looks like you\'re actively using Ptah.sh with multiple custom services. We\'d love to hear about your experience and any suggestions you might have for improvements.'); | ||
} | ||
|
||
return $message | ||
->line('Your feedback is invaluable to us and will help shape the future of Ptah.sh.') | ||
->line('Also, we invite you to join our Discord community to connect with other users and our team.') | ||
->action('Join Our Discord', 'https://r.ptah.sh/chat') | ||
->line('Thank you for being a part of Ptah.sh!'); | ||
} | ||
|
||
/** | ||
* Get the array representation of the notification. | ||
* | ||
* @return array<string, mixed> | ||
*/ | ||
public function toArray(object $notifiable): array | ||
{ | ||
return [ | ||
// | ||
]; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters