Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍
TypeScript angularetffinancefintechghostfoliohacktoberfestinvestingnestjsosspersonal-financeportfolioprismasoftwarestocktrackertradingtypescriptwealth-managementweb
Task/improve line breaks in email templates (#7332)
Thomas Kaul465798f6c2d5
diff --git a/apps/client/src/app/components/admin-settings/admin-settings.component.html b/apps/client/src/app/components/admin-settings/admin-settings.component.htmlindex 643737c4dd..c2ed2f8f5d 100644--- a/apps/client/src/app/components/admin-settings/admin-settings.component.html+++ b/apps/client/src/app/components/admin-settings/admin-settings.component.html@@ -21,8 +21,8 @@<mat-card-actions class="pb-3 pt-0 px-3"><aclass="special"- href="mailto:[email protected]?subject=Ghostfolio Premium Data Provider&body=Hello,%0D%0DI am interested in the Ghostfolio Premium data provider. Could you please give me access so I can try it for some time?%0D%0DKind regards"mat-flat-button+ [href]="premiumDataProviderMailHref"><ng-container i18n>Get Access</ng-container></a>diff --git a/apps/client/src/app/components/admin-settings/admin-settings.component.ts b/apps/client/src/app/components/admin-settings/admin-settings.component.tsindex d030abb829..c08f2d4736 100644--- a/apps/client/src/app/components/admin-settings/admin-settings.component.ts+++ b/apps/client/src/app/components/admin-settings/admin-settings.component.ts@@ -2,7 +2,10 @@ import { GfAdminPlatformComponent } from '@ghostfolio/client/components/admin-plimport { GfAdminTagComponent } from '@ghostfolio/client/components/admin-tag/admin-tag.component';import { GfDataProviderStatusComponent } from '@ghostfolio/client/components/data-provider-status/data-provider-status.component';import { UserService } from '@ghostfolio/client/services/user/user.service';-import { PROPERTY_API_KEY_GHOSTFOLIO } from '@ghostfolio/common/config';+import {+ E_MAIL_LINE_BREAK,+ PROPERTY_API_KEY_GHOSTFOLIO+} from '@ghostfolio/common/config';import { ConfirmationDialogType } from '@ghostfolio/common/enums';import { getDateFormatString } from '@ghostfolio/common/helper';import {@@ -80,6 +83,13 @@ export class GfAdminSettingsComponent implements OnInit {public ghostfolioApiStatus: DataProviderGhostfolioStatusResponse;public isGhostfolioApiKeyValid: boolean;public isLoading = false;+ public readonly premiumDataProviderMailHref = `mailto:[email protected]?subject=Ghostfolio Premium Data Provider&body=${[+ 'Hello,',+ '',+ 'I am interested in the Ghostfolio Premium data provider. Could you please give me access so I can try it for some time?',+ '',+ 'Kind regards'+ ].join(E_MAIL_LINE_BREAK)}`;public pricingUrl: string;public user: User;diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.tsindex c5beb6c2de..52e0a14d4e 100644--- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts+++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts@@ -1,6 +1,7 @@import { UserService } from '@ghostfolio/client/services/user/user.service';import {DEFAULT_PAGE_SIZE,+ E_MAIL_LINE_BREAK,NUMERICAL_PRECISION_THRESHOLD_3_FIGURES,NUMERICAL_PRECISION_THRESHOLD_4_FIGURES} from '@ghostfolio/common/config';@@ -169,7 +170,7 @@ export class GfHoldingDetailDialogComponent implements OnInit {protected readonly pageSize = DEFAULT_PAGE_SIZE;protected quantity: number;protected quantityPrecision = 2;- protected reportDataGlitchMail: string;+ protected reportDataGlitchMailHref: string;protected readonly round = round;protected readonly routerLinkAdminControlMarketData =internalRoutes.adminControl.subRoutes.marketData.routerLink;@@ -456,7 +457,20 @@ export class GfHoldingDetailDialogComponent implements OnInit {this.assetProfile?.symbol ? ` (${this.assetProfile.symbol})` : ''}`;- this.reportDataGlitchMail = `mailto:[email protected]?subject=${reportDataGlitchSubject}&body=Hello%0D%0DI would like to report a data glitch for%0D%0DSymbol: ${this.assetProfile?.symbol}%0DData Source: ${this.assetProfile?.dataSource}%0D%0DAdditional notes:%0D%0DCan you please take a look?%0D%0DKind regards`;+ this.reportDataGlitchMailHref = `mailto:[email protected]?subject=${reportDataGlitchSubject}&body=${[+ 'Hello',+ '',+ 'I would like to report a data glitch for',+ '',+ `Symbol: ${this.assetProfile?.symbol}`,+ `Data Source: ${this.assetProfile?.dataSource}`,+ '',+ 'Additional notes:',+ '',+ 'Can you please take a look?',+ '',+ 'Kind regards'+ ].join(E_MAIL_LINE_BREAK)}`;if (this.assetProfile?.assetClass) {this.assetClass = translate(this.assetProfile?.assetClass);diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.htmlindex 04388bddbd..f233df8b63 100644--- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html+++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html@@ -456,7 +456,10 @@dataSource?.data.length > 0 &&data.hasPermissionToReportDataGlitch === true) {- <a color="warn" mat-stroked-button [href]="reportDataGlitchMail"+ <a+ color="warn"+ mat-stroked-button+ [href]="reportDataGlitchMailHref"><ion-icon class="mr-1" name="flag-outline" /><span i18n>Report Data Glitch</span>...</adiff --git a/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts b/apps/client/src/app/components/user-account-membership/user-account-membership.component.tsindex 74ee2f64a9..63bf6e24e9 100644--- a/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts+++ b/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts@@ -1,4 +1,5 @@import { UserService } from '@ghostfolio/client/services/user/user.service';+import { E_MAIL_LINE_BREAK } from '@ghostfolio/common/config';import { ConfirmationDialogType } from '@ghostfolio/common/enums';import { getDateFormatString } from '@ghostfolio/common/helper';import { User } from '@ghostfolio/common/interfaces';@@ -48,8 +49,13 @@ export class GfUserAccountMembershipComponent {protected hasPermissionToCreateApiKey: boolean;protected hasPermissionToUpdateUserSettings: boolean;protected price: number;- protected readonly trySubscriptionMail =- 'mailto:[email protected]?subject=Ghostfolio Premium Trial&body=Hello%0D%0DI am interested in Ghostfolio Premium. Can you please send me a coupon code to try it for some time?%0D%0DKind regards';+ protected readonly trySubscriptionMailHref = `mailto:[email protected]?subject=Ghostfolio Premium Trial&body=${[+ 'Hello',+ '',+ 'I am interested in Ghostfolio Premium. Can you please send me a coupon code to try it for some time?',+ '',+ 'Kind regards'+ ].join(E_MAIL_LINE_BREAK)}`;protected user: User;private couponId: string | undefined;diff --git a/apps/client/src/app/components/user-account-membership/user-account-membership.html b/apps/client/src/app/components/user-account-membership/user-account-membership.htmlindex 31d2392154..7028ea5c8e 100644--- a/apps/client/src/app/components/user-account-membership/user-account-membership.html+++ b/apps/client/src/app/components/user-account-membership/user-account-membership.html@@ -49,7 +49,10 @@}<div class="align-items-center d-flex justify-content-center mt-4">@if (!user?.subscription?.expiresAt) {- <a class="mx-1" mat-stroked-button [href]="trySubscriptionMail"+ <a+ class="mx-1"+ mat-stroked-button+ [href]="trySubscriptionMailHref"><span i18n>Try Premium</span><gf-premium-indicatorclass="d-inline-block ml-1"diff --git a/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts b/apps/client/src/app/components/user-account-settings/user-account-settings.component.tsindex c9626b1887..a62760dad4 100644--- a/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts+++ b/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts@@ -5,6 +5,7 @@ import {} from '@ghostfolio/client/services/settings-storage.service';import { UserService } from '@ghostfolio/client/services/user/user.service';import { WebAuthnService } from '@ghostfolio/client/services/web-authn.service';+import { E_MAIL_LINE_BREAK } from '@ghostfolio/common/config';import { ConfirmationDialogType } from '@ghostfolio/common/enums';import { downloadAsFile } from '@ghostfolio/common/helper';import { User } from '@ghostfolio/common/interfaces';@@ -72,7 +73,7 @@ import { catchError } from 'rxjs/operators';export class GfUserAccountSettingsComponent implements OnInit {protected readonly appearancePlaceholder = $localize`Auto`;protected readonly baseCurrency: string;- protected closeUserAccountMail: string;+ protected closeUserAccountMailHref: string;protected readonly currencies: string[] = [];protected readonly deleteOwnUserForm = inject(NonNullableFormBuilder).group({accessToken: ['', Validators.required]@@ -126,7 +127,15 @@ export class GfUserAccountSettingsComponent implements OnInit {if (state?.user) {this.user = state.user;- this.closeUserAccountMail = `mailto:[email protected]?subject=Delete Account&body=Hello%0D%0DPlease delete my Ghostfolio account.%0D%0DUser ID: ${this.user.id}%0D%0DKind regards`;+ this.closeUserAccountMailHref = `mailto:[email protected]?subject=Delete Account&body=${[+ 'Hello',+ '',+ 'Please delete my Ghostfolio account.',+ '',+ `User ID: ${this.user.id}`,+ '',+ 'Kind regards'+ ].join(E_MAIL_LINE_BREAK)}`;this.hasPermissionToDeleteOwnUser = hasPermission(this.user.permissions,diff --git a/apps/client/src/app/components/user-account-settings/user-account-settings.html b/apps/client/src/app/components/user-account-settings/user-account-settings.htmlindex 351e718ec6..e77a89b24d 100644--- a/apps/client/src/app/components/user-account-settings/user-account-settings.html+++ b/apps/client/src/app/components/user-account-settings/user-account-settings.html@@ -349,7 +349,11 @@first before your Ghostfolio account can be closed.</div>} @else if (hasPermissionToRequestOwnUserDeletion) {- <a color="warn" i18n mat-flat-button [href]="closeUserAccountMail"+ <a+ color="warn"+ i18n+ mat-flat-button+ [href]="closeUserAccountMailHref">Close Account</a>}diff --git a/libs/common/src/lib/config.ts b/libs/common/src/lib/config.tsindex e071a72c5d..f7bafb1019 100644--- a/libs/common/src/lib/config.ts+++ b/libs/common/src/lib/config.ts@@ -184,6 +184,8 @@ export const DERIVED_CURRENCIES = [}];+export const E_MAIL_LINE_BREAK = '%0D%0A';+export const GATHER_ASSET_PROFILE_PROCESS_JOB_NAME = 'GATHER_ASSET_PROFILE';export const GATHER_ASSET_PROFILE_PROCESS_JOB_OPTIONS: JobOptions = {attempts: 12,