Skip to content

Commit a24f913

Browse files
feat: setup support email
1 parent 41f1f5c commit a24f913

4 files changed

Lines changed: 23 additions & 3 deletions

File tree

setup/setup.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,20 @@ $webAppUrl = $appUrl
177177
$adminPanelUrl = Get-SubdomainUrl -baseUrl $appUrl -subdomain "admin"
178178
$apiUrl = Get-SubdomainUrl -baseUrl $appUrl -subdomain "api"
179179

180+
# Generate support email from the application URL
181+
function Get-SupportEmail {
182+
param ([string]$url)
183+
184+
if ($url -match '^(https?://)([^/]+)(.*)$') {
185+
$domain = $matches[2]
186+
return "support@$domain"
187+
}
188+
189+
return "support@example.com"
190+
}
191+
192+
$supportEmail = Get-SupportEmail -url $appUrl
193+
180194
# Get admin user details
181195
$adminMobile = Get-UserInput -prompt "Enter admin user mobile number" -default $defaultSettings.Identity.AdminUser.Mobile -validationType 'mobile'
182196
$adminEmail = Get-UserInput -prompt "Enter admin user email" -default $defaultSettings.Identity.AdminUser.Email -validationType 'email'
@@ -211,6 +225,7 @@ try {
211225
# Only replace the application name in specific places
212226
$content = $content -replace '"Application":\s*{\s*"Default":\s*{\s*"Name":\s*"[^"]*"', "`"Application`": { `"Default`": { `"Name`": `"$appName`""
213227
$content = $content -replace '"Url":\s*"[^"]*"', "`"Url`": `"$currentUrl`""
228+
$content = $content -replace '"SupportEmail":\s*"[^"]*"', "`"SupportEmail`": `"$supportEmail`""
214229

215230
# Update JWT Issuer for API project
216231
if ($_.FullName -like "*Api*") {
@@ -347,5 +362,7 @@ Write-Host "API URL: " -NoNewline
347362
Write-Host $apiUrl -ForegroundColor Yellow
348363
Write-Host "Admin Email: " -NoNewline
349364
Write-Host $adminEmail -ForegroundColor Yellow
365+
Write-Host "Support Email: " -NoNewline
366+
Write-Host $supportEmail -ForegroundColor Yellow
350367

351368
Write-Host "`nYou can now build and run your application." -ForegroundColor Green

src/2-Clients/AdminPanel/appsettings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"Application": {
44
"Default": {
55
"Name": "Can Be Yours",
6-
"Url": "https://admin.canbeyours.online/"
6+
"Url": "https://admin.canbeyours.online/",
7+
"SupportEmail": "support@canbeyours.online"
78
}
89
},
910
"MongoDB": {

src/2-Clients/Api/appsettings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"Application": {
55
"Default": {
66
"Name": "Can Be Yours",
7-
"Url": "https://api.canbeyours.online/"
7+
"Url": "https://api.canbeyours.online/",
8+
"SupportEmail": "support@canbeyours.online"
89
}
910
},
1011
"MongoDB": {

src/2-Clients/WebApp/appsettings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"Application": {
44
"Default": {
55
"Name": "Can Be Yours",
6-
"Url": "https://canbeyours.online/"
6+
"Url": "https://canbeyours.online/",
7+
"SupportEmail": "support@canbeyours.online"
78
}
89
},
910
"MongoDB": {

0 commit comments

Comments
 (0)