MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / sendLoginVerificationEmail

Method sendLoginVerificationEmail

lib/models/email.ts:585–629  ·  view source on GitHub ↗
(
    email: string,
    verificationCode: string,
  )

Source from the content-addressed store, hash-verified

583 }
584
585 static async sendLoginVerificationEmail(
586 email: string,
587 verificationCode: string,
588 ) {
589 const emailTitle = 'Verify your login in bewCloud';
590
591 const textBody = `
592${emailTitle}
593------------------------
594
595You or someone who knows your email and password is trying to login to bewCloud.
596
597Here's the verification code:
598
599**${verificationCode}**
600===============================
601
602This code will expire in 30 minutes.
603 `;
604
605 const htmlBody = this.getHtmlBody(
606 emailTitle,
607 `
608 <h1>${escapeHtml(emailTitle)}</h1>
609 <p>You or someone who knows your email and password is trying to login to bewCloud.</p>
610 <p>Here's the verification code:</p>
611 <table class="body-action" align="center" width="100%" cellpadding="0" cellspacing="0" role="presentation">
612 <tr>
613 <td align="center">
614 <table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation">
615 <tr>
616 <td align="center">
617 <span class="f-fallback button button--green">${escapeHtml(verificationCode)}</span>
618 </td>
619 </tr>
620 </table>
621 </td>
622 </tr>
623 </table>
624 <p>This code will expire in 30 minutes.</p>
625 `,
626 );
627
628 await this.send(email, emailTitle, htmlBody, textBody);
629 }
630}

Callers 1

createAndSendCodeMethod · 0.80

Calls 3

getHtmlBodyMethod · 0.95
sendMethod · 0.95
escapeHtmlFunction · 0.90

Tested by

no test coverage detected