diff --git a/src/Kanvas/Enums/AppSettingsEnums.php b/src/Kanvas/Enums/AppSettingsEnums.php index a1d72f493..10a948cb2 100644 --- a/src/Kanvas/Enums/AppSettingsEnums.php +++ b/src/Kanvas/Enums/AppSettingsEnums.php @@ -12,6 +12,7 @@ enum AppSettingsEnums implements EnumsInterface case DEFAULT_COUNTRY; case DEFAULT_LANGUAGE; case SEND_WELCOME_EMAIL; + case WELCOME_EMAIL_CONFIG; case SEND_CREATE_USER_EMAIL; case ONBOARDING_GUILD_SETUP; case ONBOARDING_INVENTORY_SETUP; @@ -38,6 +39,7 @@ public function getValue(): mixed self::DEFAULT_COUNTRY => 'default_user_country', self::DEFAULT_LANGUAGE => 'language', self::SEND_WELCOME_EMAIL => 'send_welcome_email', + self::WELCOME_EMAIL_CONFIG => 'welcome_email_template_config', self::SEND_CREATE_USER_EMAIL => 'send_create_user_email', self::ONBOARDING_GUILD_SETUP => 'onboarding_guild_setup', self::ONBOARDING_INVENTORY_SETUP => 'onboarding_inventory_setup', diff --git a/src/Kanvas/Users/Services/UserNotificationService.php b/src/Kanvas/Users/Services/UserNotificationService.php index be733a870..8381c0004 100644 --- a/src/Kanvas/Users/Services/UserNotificationService.php +++ b/src/Kanvas/Users/Services/UserNotificationService.php @@ -45,9 +45,12 @@ public static function sendWelcomeEmail( ): void { try { if ($app->get((string) AppSettingsEnums::SEND_WELCOME_EMAIL->getValue())) { + $welcomeEmailConfig = $app->get((string) AppSettingsEnums::WELCOME_EMAIL_CONFIG->getValue()) ?? []; + + $title = $welcomeEmailConfig['title'] ?? 'Welcome to ' . $app->name; $user->notify(new Welcome( $user, - $company ? ['company' => $company, 'subject' => 'Welcome to ' . $company->name, 'app' => $app] : ['app' => $app] + $company ? ['company' => $company, 'subject' => $title, 'app' => $app] : ['app' => $app] )); } } catch (Throwable $e) {