Merge pull request #2856 from Infisical/omar/eng-1806-add-instance-url-to-email-verification-for-infisical

improvement: Add email footer with instance URL
This commit is contained in:
Maidul Islam
2024-12-11 19:48:27 -05:00
committed by GitHub
21 changed files with 108 additions and 61 deletions
@@ -53,6 +53,13 @@ export const smtpServiceFactory = (cfg: TSmtpConfig) => {
const smtp = createTransport(cfg); const smtp = createTransport(cfg);
const isSmtpOn = Boolean(cfg.host); const isSmtpOn = Boolean(cfg.host);
handlebars.registerHelper("emailFooter", () => {
const { SITE_URL } = getConfig();
return new handlebars.SafeString(
`<p style="font-size: 12px;">Email sent via Infisical at <a href="${SITE_URL}">${SITE_URL}</a></p>`
);
});
const sendMail = async ({ substitutions, recipients, template, subjectLine }: TSmtpSendMail) => { const sendMail = async ({ substitutions, recipients, template, subjectLine }: TSmtpSendMail) => {
const appCfg = getConfig(); const appCfg = getConfig();
const html = await fs.readFile(path.resolve(__dirname, "./templates/", template), "utf8"); const html = await fs.readFile(path.resolve(__dirname, "./templates/", template), "utf8");
@@ -45,6 +45,8 @@
View the request and approve or deny it View the request and approve or deny it
<a href="{{approvalUrl}}">here</a>. <a href="{{approvalUrl}}">here</a>.
</p> </p>
{{emailFooter}}
</body> </body>
</html> </html>
@@ -11,8 +11,11 @@
<p>A secret approval request has been bypassed in the project "{{projectName}}".</p> <p>A secret approval request has been bypassed in the project "{{projectName}}".</p>
<p> <p>
{{requesterFullName}} ({{requesterEmail}}) has merged {{requesterFullName}}
a secret to environment {{environment}} at secret path {{secretPath}} ({{requesterEmail}}) has merged a secret to environment
{{environment}}
at secret path
{{secretPath}}
without obtaining the required approvals. without obtaining the required approvals.
</p> </p>
<p> <p>
@@ -24,5 +27,7 @@
To review this action, please visit the request panel To review this action, please visit the request panel
<a href="{{approvalUrl}}">here</a>. <a href="{{approvalUrl}}">here</a>.
</p> </p>
{{emailFooter}}
</body> </body>
</html> </html>
@@ -1,4 +1,3 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
@@ -14,6 +13,8 @@
<h2>{{code}}</h2> <h2>{{code}}</h2>
<p>The MFA code will be valid for 2 minutes.</p> <p>The MFA code will be valid for 2 minutes.</p>
<p>Not you? Contact {{#if isCloud}}Infisical{{else}}your administrator{{/if}} immediately.</p> <p>Not you? Contact {{#if isCloud}}Infisical{{else}}your administrator{{/if}} immediately.</p>
{{emailFooter}}
</body> </body>
</html> </html>
@@ -10,6 +10,8 @@
<h2>Confirm your email address</h2> <h2>Confirm your email address</h2>
<p>Your confirmation code is below — enter it in the browser window where you've started confirming your email.</p> <p>Your confirmation code is below — enter it in the browser window where you've started confirming your email.</p>
<h1>{{code}}</h1> <h1>{{code}}</h1>
{{emailFooter}}
</body> </body>
</html> </html>
@@ -16,6 +16,7 @@
<p>Error: {{error}}</p> <p>Error: {{error}}</p>
{{emailFooter}}
</body> </body>
</html> </html>
@@ -12,6 +12,8 @@
{{provider}} {{provider}}
to Infisical is in progress. The import process may take up to 30 minutes, and you will receive once the import to Infisical is in progress. The import process may take up to 30 minutes, and you will receive once the import
has finished or if it fails.</p> has finished or if it fails.</p>
{{emailFooter}}
</body> </body>
</html> </html>
@@ -9,6 +9,8 @@
<body> <body>
<h2>An import from {{provider}} to Infisical was successful</h2> <h2>An import from {{provider}} to Infisical was successful</h2>
<p>An import from {{provider}} was successful. Your data is now available in Infisical.</p> <p>An import from {{provider}} was successful. Your data is now available in Infisical.</p>
{{emailFooter}}
</body> </body>
</html> </html>
@@ -1,21 +1,21 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge"> <meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>Incident alert: secrets potentially leaked</title> <title>Incident alert: secrets potentially leaked</title>
</head> </head>
<body> <body>
<h3>Infisical has uncovered {{numberOfSecrets}} secret(s) from historical commits to your repo</h3> <h3>Infisical has uncovered {{numberOfSecrets}} secret(s) from historical commits to your repo</h3>
<p><a href="{{siteUrl}}/secret-scanning"><strong>View leaked secrets</strong></a></p> <p><a href="{{siteUrl}}/secret-scanning"><strong>View leaked secrets</strong></a></p>
<p>If these are production secrets, please rotate them immediately.</p> <p>If these are production secrets, please rotate them immediately.</p>
<p>Once you have taken action, be sure to update the status of the risk in your <a <p>Once you have taken action, be sure to update the status of the risk in your
href="{{siteUrl}}">Infisical <a href="{{siteUrl}}">Infisical dashboard</a>.</p>
dashboard</a>.</p>
</body> {{emailFooter}}
</body>
</html> </html>
@@ -26,6 +26,8 @@
{{#if syncMessage}} {{#if syncMessage}}
<p><b>Reason: </b>{{syncMessage}}</p> <p><b>Reason: </b>{{syncMessage}}</p>
{{/if}} {{/if}}
{{emailFooter}}
</body> </body>
</html> </html>
@@ -1,4 +1,3 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
@@ -13,7 +12,11 @@
<p><strong>Timestamp</strong>: {{timestamp}}</p> <p><strong>Timestamp</strong>: {{timestamp}}</p>
<p><strong>IP address</strong>: {{ip}}</p> <p><strong>IP address</strong>: {{ip}}</p>
<p><strong>User agent</strong>: {{userAgent}}</p> <p><strong>User agent</strong>: {{userAgent}}</p>
<p>If you believe that this login is suspicious, please contact {{#if isCloud}}Infisical{{else}}your administrator{{/if}} or reset your password immediately.</p> <p>If you believe that this login is suspicious, please contact
{{#if isCloud}}Infisical{{else}}your administrator{{/if}}
or reset your password immediately.</p>
{{emailFooter}}
</body> </body>
</html> </html>
@@ -12,5 +12,7 @@
<a href="{{callback_url}}?token={{token}}{{#if metadata}}&metadata={{metadata}}{{/if}}&to={{email}}&organization_id={{organizationId}}">Click to join</a> <a href="{{callback_url}}?token={{token}}{{#if metadata}}&metadata={{metadata}}{{/if}}&to={{email}}&organization_id={{organizationId}}">Click to join</a>
<h3>What is Infisical?</h3> <h3>What is Infisical?</h3>
<p>Infisical is an easy-to-use end-to-end encrypted tool that enables developers to sync and manage their secrets and configs.</p> <p>Infisical is an easy-to-use end-to-end encrypted tool that enables developers to sync and manage their secrets and configs.</p>
{{emailFooter}}
</body> </body>
</html> </html>
@@ -1,14 +1,16 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge"> <meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>Account Recovery</title> <title>Account Recovery</title>
</head> </head>
<body> <body>
<h2>Reset your password</h2> <h2>Reset your password</h2>
<p>Someone requested a password reset.</p> <p>Someone requested a password reset.</p>
<a href="{{callback_url}}?token={{token}}&to={{email}}">Reset password</a> <a href="{{callback_url}}?token={{token}}&to={{email}}">Reset password</a>
<p>If you didn't initiate this request, please contact {{#if isCloud}}us immediately at [email protected].{{else}}your administrator immediately.{{/if}}</p> <p>If you didn't initiate this request, please contact
</body> {{#if isCloud}}us immediately at [email protected].{{else}}your administrator immediately.{{/if}}</p>
{{emailFooter}}
</body>
</html> </html>
@@ -27,5 +27,7 @@
<p>Please take necessary actions to renew these items before they expire.</p> <p>Please take necessary actions to renew these items before they expire.</p>
<p>For more details, please log in to your Infisical account and check your PKI management section.</p> <p>For more details, please log in to your Infisical account and check your PKI management section.</p>
{{emailFooter}}
</body> </body>
</html> </html>
@@ -1,16 +1,18 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge"> <meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>Organization Invitation</title> <title>Organization Invitation</title>
</head> </head>
<body> <body>
<h2>Join your organization on Infisical</h2> <h2>Join your organization on Infisical</h2>
<p>You've been invited to join the Infisical organization — {{organizationName}}</p> <p>You've been invited to join the Infisical organization — {{organizationName}}</p>
<a href="{{callback_url}}">Join now</a> <a href="{{callback_url}}">Join now</a>
<h3>What is Infisical?</h3> <h3>What is Infisical?</h3>
<p>Infisical is an easy-to-use end-to-end encrypted tool that enables developers to sync and manage their secrets and configs.</p> <p>Infisical is an easy-to-use end-to-end encrypted tool that enables developers to sync and manage their secrets
</body> and configs.</p>
{{emailFooter}}
</body>
</html> </html>
@@ -17,6 +17,8 @@
View the request and approve or deny it View the request and approve or deny it
<a href="{{approvalUrl}}">here</a>. <a href="{{approvalUrl}}">here</a>.
</p> </p>
{{emailFooter}}
</body> </body>
</html> </html>
@@ -1,25 +1,27 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge"> <meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>Incident alert: secret leaked</title> <title>Incident alert: secret leaked</title>
</head> </head>
<body> <body>
<h3>Infisical has uncovered {{numberOfSecrets}} secret(s) from your recent push</h3> <h3>Infisical has uncovered {{numberOfSecrets}} secret(s) from your recent push</h3>
<p><a href="{{siteUrl}}/secret-scanning"><strong>View leaked secrets</strong></a></p> <p><a href="{{siteUrl}}/secret-scanning"><strong>View leaked secrets</strong></a></p>
<p>You are receiving this notification because one or more secret leaks have been detected in a recent commit pushed <p>You are receiving this notification because one or more secret leaks have been detected in a recent commit pushed
by {{pusher_name}} ({{pusher_email}}). If by
these are test secrets, please add `infisical-scan:ignore` at the end of the line containing the secret as comment {{pusher_name}}
in the given programming. This will prevent future notifications from being sent out for those secret(s).</p> ({{pusher_email}}). If these are test secrets, please add `infisical-scan:ignore` at the end of the line
containing the secret as comment in the given programming. This will prevent future notifications from being sent
out for those secret(s).</p>
<p>If these are production secrets, please rotate them immediately.</p> <p>If these are production secrets, please rotate them immediately.</p>
<p>Once you have taken action, be sure to update the status of the risk in your <a <p>Once you have taken action, be sure to update the status of the risk in your
href="{{siteUrl}}">Infisical <a href="{{siteUrl}}">Infisical dashboard</a>.</p>
dashboard</a>.</p>
</body> {{emailFooter}}
</body>
</html> </html>
@@ -13,6 +13,8 @@
{{#if reminderNote}} {{#if reminderNote}}
<p>Here's the note included with the reminder: {{reminderNote}}</p> <p>Here's the note included with the reminder: {{reminderNote}}</p>
{{/if}} {{/if}}
{{emailFooter}}
</body> </body>
</html> </html>
@@ -1,17 +1,19 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge"> <meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>Code</title> <title>Code</title>
</head> </head>
<body> <body>
<h2>Confirm your email address</h2> <h2>Confirm your email address</h2>
<p>Your confirmation code is below — enter it in the browser window where you've started signing up for Infisical.</p> <p>Your confirmation code is below — enter it in the browser window where you've started signing up for Infisical.</p>
<h1>{{code}}</h1> <h1>{{code}}</h1>
<p>Questions about setting up Infisical? {{#if isCloud}}Email us at [email protected]{{else}}Contact your administrator{{/if}}.</p> <p>Questions about setting up Infisical?
</body> {{#if isCloud}}Email us at [email protected]{{else}}Contact your administrator{{/if}}.</p>
{{emailFooter}}
</body>
</html> </html>
@@ -11,6 +11,8 @@
<p>Your account has been temporarily locked due to multiple failed login attempts. </h2> <p>Your account has been temporarily locked due to multiple failed login attempts. </h2>
<a href="{{callback_url}}?token={{token}}">To unlock your account, follow the link here</a> <a href="{{callback_url}}?token={{token}}">To unlock your account, follow the link here</a>
<p>If these attempts were not made by you, reset your password immediately.</p> <p>If these attempts were not made by you, reset your password immediately.</p>
{{emailFooter}}
</body> </body>
</html> </html>
@@ -11,5 +11,7 @@
<h3>What is Infisical?</h3> <h3>What is Infisical?</h3>
<p>Infisical is an easy-to-use end-to-end encrypted tool that enables developers to sync and manage their secrets <p>Infisical is an easy-to-use end-to-end encrypted tool that enables developers to sync and manage their secrets
and configs.</p> and configs.</p>
{{emailFooter}}
</body> </body>
</html> </html>