📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
project invitaiton email
Blue Mouse1d9f83c0beb4
diff --git a/backend/apps/community/src/common/templates/en/customer_project-invitation.html b/backend/apps/community/src/common/templates/en/customer_project-invitation.htmlindex bcf5fe809..c5511765f 100644--- a/backend/apps/community/src/common/templates/en/customer_project-invitation.html+++ b/backend/apps/community/src/common/templates/en/customer_project-invitation.html@@ -1,11 +1,3 @@<a href="mailto:{{email}}">{{email}}</a> has invited you to the {{name}} website analytics dashboard with the role {{role}} on their Swetrix Community Edition instance.<br/>-Click the button below to accept the invitation or ignore this email if you do not want to join the project.-<br/>-The invitation will expire in {{expiration}} hours.-<br/>-<a href="{{url}}" target="_blank">Accept invitation</a>-<br/>-If you are having trouble with the button above, copy and paste the URL below directly into your web browser:-<br/>-{{url}}+You can accept or decline the invitation in your dashboard.diff --git a/backend/apps/community/src/common/templates/en/project-transfer.html b/backend/apps/community/src/common/templates/en/project-transfer.htmldeleted file mode 100644index cc870ade1..000000000--- a/backend/apps/community/src/common/templates/en/project-transfer.html+++ /dev/null@@ -1,13 +0,0 @@-A Swetrix Community Edition user wants to transfer of the {{name}} project to your account.-<br/>-If you accept the invitation, this project well be transferred to your account and the previous owner will be added as an administator (you will be able to edit project admins and viewers in the project settings).-<br />-<a href="{{confirmUrl}}" target="_blank">Accept transfer</a> | <a href="{{cancelUrl}}" target="_blank">Decline transfer</a>-<br /><br />-If you are having trouble with the button above, copy and paste the URL below directly into your web browser to accept transfer:-<br />-{{confirmUrl}}-<br /><br />-Or copy and paste the URL below directly into your web browser to decline transfer:-<br/>-{{cancelUrl}}diff --git a/backend/apps/community/src/mailer/letter.ts b/backend/apps/community/src/mailer/letter.tsindex 58f309f42..2ba13b296 100644--- a/backend/apps/community/src/mailer/letter.ts+++ b/backend/apps/community/src/mailer/letter.ts@@ -4,5 +4,4 @@ export enum LetterTemplate {MailAddressChangeConfirmation = 'mailaddress-change_confirmation',MailAddressHadChanged = 'mailaddress-change_information',ProjectInvitation = 'customer_project-invitation',- ProjectTransfer = 'project-transfer',}diff --git a/backend/apps/community/src/mailer/mailer.service.ts b/backend/apps/community/src/mailer/mailer.service.tsindex dc4156331..ab3a72425 100644--- a/backend/apps/community/src/mailer/mailer.service.ts+++ b/backend/apps/community/src/mailer/mailer.service.ts@@ -33,12 +33,6 @@ const metaInfoJson = {en: () => 'You have been invited to join the project',},},- [LetterTemplate.ProjectTransfer]: {- subject: {- en: (p: Params) =>- `A Swetrix user offers to transfer ${p.name} project to your account`,- },- },}interface Params {diff --git a/backend/apps/community/src/project/project.controller.ts b/backend/apps/community/src/project/project.controller.tsindex 073f70840..d27594c17 100644--- a/backend/apps/community/src/project/project.controller.ts+++ b/backend/apps/community/src/project/project.controller.ts@@ -102,6 +102,8 @@ import { UpdateProjectViewDto } from './dto/update-project-view.dto'import { UserService } from '../user/user.service'import { Roles } from '../auth/decorators/roles.decorator'import { UserType } from '../user/entities/user.entity'+import { MailerService } from '../mailer/mailer.service'+import { LetterTemplate } from '../mailer/letter'@ApiTags('Project')@Controller(['project', 'v1/project'])@@ -110,6 +112,7 @@ export class ProjectController {private readonly projectService: ProjectService,private readonly logger: AppLoggerService,private readonly userService: UserService,+ private readonly mailerService: MailerService,) {}@Get('/')@@ -386,6 +389,16 @@ export class ProjectController {const id = uuidv4()+ await this.mailerService.sendEmail(+ invitee.email,+ LetterTemplate.ProjectInvitation,+ {+ email: inviter.email,+ name: project.name,+ role: body.role,+ },+ )+await createProjectShareClickhouse({id,userId: invitee.id,diff --git a/backend/apps/community/src/project/project.module.ts b/backend/apps/community/src/project/project.module.tsindex 805c36413..51a200027 100644--- a/backend/apps/community/src/project/project.module.ts+++ b/backend/apps/community/src/project/project.module.ts@@ -4,9 +4,10 @@ import { ProjectService } from './project.service'import { ProjectController } from './project.controller'import { AppLoggerModule } from '../logger/logger.module'import { UserModule } from '../user/user.module'+import { MailerModule } from '../mailer/mailer.module'@Module({- imports: [AppLoggerModule, UserModule],+ imports: [AppLoggerModule, UserModule, MailerModule],providers: [ProjectService],exports: [ProjectService],controllers: [ProjectController],