-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nishad <nishad.shirsat@ayanworks.com> Signed-off-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>
- Loading branch information
1 parent
0955455
commit d4e50fa
Showing
9 changed files
with
267 additions
and
2 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
apps/api-gateway/src/ecosystem/dtos/send-invitation.dto.ts
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,28 @@ | ||
import { ApiExtraModels, ApiProperty } from '@nestjs/swagger'; | ||
import { IsArray, IsEmail, IsNotEmpty, IsString, ValidateNested } from 'class-validator'; | ||
import { Transform, Type } from 'class-transformer'; | ||
|
||
import { trim } from '@credebl/common/cast.helper'; | ||
|
||
@ApiExtraModels() | ||
export class EcosystemInvitationDto { | ||
|
||
@ApiProperty({ example: 'acqx@getnada.com' }) | ||
@IsEmail() | ||
@Transform(({ value }) => trim(value)) | ||
@IsNotEmpty({ message: 'Please provide valid email' }) | ||
@IsString({ message: 'email should be string' }) | ||
email: string; | ||
|
||
} | ||
|
||
@ApiExtraModels() | ||
export class BulkEcosystemInvitationDto { | ||
|
||
@ApiProperty({ type: [EcosystemInvitationDto] }) | ||
@IsArray() | ||
@ValidateNested({ each: true }) | ||
@Type(() => EcosystemInvitationDto) | ||
invitations: EcosystemInvitationDto[]; | ||
ecosystemId: string; | ||
} |
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
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,12 @@ | ||
import { ApiExtraModels } from '@nestjs/swagger'; | ||
|
||
@ApiExtraModels() | ||
export class SendInvitationDto { | ||
email: string; | ||
} | ||
|
||
@ApiExtraModels() | ||
export class BulkSendInvitationDto { | ||
invitations: SendInvitationDto[]; | ||
ecosystemId: string; | ||
} |
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
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
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,66 @@ | ||
export class EcosystemInviteTemplate { | ||
|
||
public sendInviteEmailTemplate( | ||
email: string, | ||
ecosystemName: string | ||
): string { | ||
|
||
const validUrl = `${process.env.FRONT_END_URL}/authentication/sign-in`; | ||
|
||
const message = `You have been invited to join the ecosystem so please log in and accept the ecosystem “INVITATION” and participate in the ecosystem`; | ||
const year: number = new Date().getFullYear(); | ||
|
||
return `<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title></title> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
</head> | ||
<body style="margin: 0px; padding:0px; background-color:#F9F9F9;"> | ||
<div style="margin: auto; width: 40%; padding: 20px 30px; background-color: #FFFFFF; display:block; word-break: break-word;"> | ||
<div style="font-family: Montserrat; font-style: normal; font-weight: 500; | ||
font-size: 15px; line-height: 24px;color: #5E5873;"> | ||
<p style="margin-top:0px"> | ||
Hello ${email}, | ||
</p> | ||
<p> | ||
Congratulations! | ||
Your have been successfully invited to join. | ||
<ul style="color:#005EFF; padding-left:10px; font-family: Montserrat;font-style: normal; | ||
font-weight: normal;font-size: 14px;line-height: 21px;"> | ||
<li>Ecosystem: ${ecosystemName}</li> | ||
</ul> | ||
${message} | ||
<ul style="color:#005EFF; padding-left:10px; font-family: Montserrat;font-style: normal; | ||
font-weight: normal;font-size: 14px;line-height: 21px;"> | ||
<li>Platform Link: <a href="${validUrl}">${validUrl}</a></li> | ||
</ul> | ||
<div style="text-align: center; padding-bottom: 20px;"> | ||
<a href="${validUrl}" | ||
style="padding: 10px 20px 10px 20px;color: #fff;background: #1F4EAD;border-radius: 5px;text-decoration: none;"> | ||
INVITATION | ||
</a> | ||
</div> | ||
<p>In case you need any assistance to access your account, please contact <a href="https://credebl.in/" | ||
target="_blank">CREDEBL Platform</a> | ||
</p> | ||
<hr style="border-top:1px solid #e8e8e8" /> | ||
<footer style="padding-top: 20px;"> | ||
<p style="margin-top: 2px;"> | ||
® CREDEBL ${year}, Powered by Blockster Labs. All Rights Reserved. | ||
</p> | ||
</footer> | ||
</div> | ||
</div> | ||
</body> | ||
</html>`; | ||
|
||
} | ||
|
||
|
||
} |