Skip to content

Commit

Permalink
fix(wallet/backend): update email templates (#1771)
Browse files Browse the repository at this point in the history
Update email templates
  • Loading branch information
raducristianpopa authored Oct 24, 2024
1 parent fc4cc3a commit 239e382
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
12 changes: 9 additions & 3 deletions packages/wallet/backend/src/email/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class EmailService implements IEmailService {
private imageSrc: string =
'https://raw.githubusercontent.com/interledger/testnet/main/packages/wallet/backend/src/email/templates/images/InterledgerTestWallet.png'
private subjectPrefix: string = 'Test.Wallet'
private appName: string = 'Interledger Test Wallet'

constructor(
private env: Env,
Expand All @@ -49,7 +50,8 @@ export class EmailService implements IEmailService {
if (this.env.GATEHUB_ENV === 'production') {
this.imageSrc =
'https://raw.githubusercontent.com/interledger/testnet/main/packages/wallet/backend/src/email/templates/images/InterledgerWallet.png'
this.subjectPrefix = 'Interledger Wallet'
this.subjectPrefix = 'Interledger Cards'
this.appName = 'Interledger Cards'
}
}

Expand Down Expand Up @@ -78,7 +80,7 @@ export class EmailService implements IEmailService {
return this.send({
to,
subject: `[${this.subjectPrefix}] Verify your account`,
html: getVerifyEmailTemplate(url, this.imageSrc)
html: getVerifyEmailTemplate(url, this.imageSrc, this.appName)
})
}

Expand Down Expand Up @@ -117,7 +119,11 @@ export class EmailService implements IEmailService {
return this.send({
to,
subject: `[${this.subjectPrefix}] You are verified`,
html: getKYCVerificationEmailTemplate(loginUrl, this.imageSrc)
html: getKYCVerificationEmailTemplate(
loginUrl,
this.imageSrc,
this.appName
)
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const getKYCVerificationEmailTemplate = (
loginUrl: string,
imageSrc: string
imageSrc: string,
appName: string
): string => {
return `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
Expand All @@ -22,12 +23,12 @@ export const getKYCVerificationEmailTemplate = (
<tbody>
<tr>
<td>
<h1 style="color:#0e7b31;font-size:36px;font-weight:500;margin:30px 0;padding:0;line-height:42px">Interledger Wallet Verification</h1>
<h1 style="color:#0e7b31;font-size:36px;font-weight:500;margin:30px 0;padding:0;line-height:42px">${appName}</h1>
</td>
</tr>
<tr>
<td>
Thank you for registering with Interledger Wallet. Your KYC data has been successfully verified. You can now <a href="${loginUrl} target="_blank">login to your account</a> and start using the Wallet.
Thank you for registering with ${appName}. Your KYC data has been successfully verified. You can now <a href="${loginUrl} target="_blank">login to your account</a> and start using the wallet.
</td>
</tr>
</tbody>
Expand Down
5 changes: 3 additions & 2 deletions packages/wallet/backend/src/email/templates/verifyEmail.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const getVerifyEmailTemplate = (
url: string,
imageSrc: string
imageSrc: string,
appName: string
): string => {
return `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
Expand Down Expand Up @@ -32,7 +33,7 @@ export const getVerifyEmailTemplate = (
</tr>
<tr>
<td>
<p style="font-size:16px;line-height:28px;margin:16px 0;margin-bottom:30px">Welcome to Interledger Test Wallet. Before we get started, click on the link bellow to verify your email address.</p>
<p style="font-size:16px;line-height:28px;margin:16px 0;margin-bottom:30px">Welcome to ${appName}. Before we get started, click on the link bellow to verify your email address.</p>
</td>
</tr>
<tr>
Expand Down

0 comments on commit 239e382

Please sign in to comment.