Browse Source

fix(scheduler): importing email contents

Karol Sójko 2 năm trước cách đây
mục cha
commit
c52bb93d79

+ 2 - 2
packages/scheduler/src/Domain/Email/EncourageEmailBackups.ts

@@ -1,9 +1,9 @@
-import { readFileSync } from 'fs'
+import { html } from './encourage-email-backups.html'
 
 
 export function getSubject(): string {
 export function getSubject(): string {
   return 'Enable email backups for your account'
   return 'Enable email backups for your account'
 }
 }
 
 
 export function getBody(): string {
 export function getBody(): string {
-  return readFileSync(`${__dirname}/encourage-email-backups.html`).toString()
+  return html
 }
 }

+ 2 - 2
packages/scheduler/src/Domain/Email/EncourageSubscriptionPurchasing.ts

@@ -1,11 +1,11 @@
-import { readFileSync } from 'fs'
+import { html } from './encourage-subscription-purchasing.html'
 
 
 export function getSubject(): string {
 export function getSubject(): string {
   return 'Checking in after one month with Standard Notes'
   return 'Checking in after one month with Standard Notes'
 }
 }
 
 
 export function getBody(registrationDate: string): string {
 export function getBody(registrationDate: string): string {
-  const body = readFileSync(`${__dirname}/encourage-subscription-purchasing.html`).toString()
+  const body = html
 
 
   return body.replace('%%REGISTRATION_DATE%%', registrationDate)
   return body.replace('%%REGISTRATION_DATE%%', registrationDate)
 }
 }

+ 2 - 2
packages/scheduler/src/Domain/Email/ExitInterview.ts

@@ -1,9 +1,9 @@
-import { readFileSync } from 'fs'
+import { html } from './exit-interview.html'
 
 
 export function getSubject(): string {
 export function getSubject(): string {
   return 'Can we ask why you canceled?'
   return 'Can we ask why you canceled?'
 }
 }
 
 
 export function getBody(): string {
 export function getBody(): string {
-  return readFileSync(`${__dirname}/exit-interview.html`).toString()
+  return html
 }
 }

+ 2 - 2
packages/scheduler/src/Domain/Email/encourage-email-backups.html → packages/scheduler/src/Domain/Email/encourage-email-backups.html.ts

@@ -1,4 +1,4 @@
-<div>
+export const html = `<div>
   <p>
   <p>
     Did you know you can enable daily email backups for your account? This <strong>free</strong> feature sends an
     Did you know you can enable daily email backups for your account? This <strong>free</strong> feature sends an
     email to your inbox with an encrypted backup file including all your notes and tags.
     email to your inbox with an encrypted backup file including all your notes and tags.
@@ -15,4 +15,4 @@
   <a href="https://standardnotes.com/help/28/how-do-i-enable-daily-email-backups">
   <a href="https://standardnotes.com/help/28/how-do-i-enable-daily-email-backups">
     Learn more about daily email backups →
     Learn more about daily email backups →
   </a>
   </a>
-</div>
+</div>`

+ 3 - 2
packages/scheduler/src/Domain/Email/encourage-subscription-purchasing.html → packages/scheduler/src/Domain/Email/encourage-subscription-purchasing.html.ts

@@ -1,4 +1,4 @@
-<div>
+export const html = `<div>
   <p>Hi there,</p>
   <p>Hi there,</p>
   <p>
   <p>
     We hope you've been finding great use out of Standard Notes. We built Standard Notes to be a secure place for
     We hope you've been finding great use out of Standard Notes. We built Standard Notes to be a secure place for
@@ -80,4 +80,5 @@
     directly to this email or send an email to <a href="help@standardnotes.com">help@standardnotes.com</a> and
     directly to this email or send an email to <a href="help@standardnotes.com">help@standardnotes.com</a> and
     we'd be happy to help.
     we'd be happy to help.
   </p>
   </p>
-</div>,
+</div>
+`

+ 2 - 1
packages/scheduler/src/Domain/Email/exit-interview.html → packages/scheduler/src/Domain/Email/exit-interview.html.ts

@@ -1,4 +1,4 @@
-<div>
+export const html = `<div>
   <p>
   <p>
     We're truly sad to see you leave. Our mission is simple: build the best, most private, and most secure
     We're truly sad to see you leave. Our mission is simple: build the best, most private, and most secure
     note-taking app available. It's clear we've fallen short of your expectations somewhere along the way.
     note-taking app available. It's clear we've fallen short of your expectations somewhere along the way.
@@ -26,3 +26,4 @@
     our support team will be in touch with you.
     our support team will be in touch with you.
   </p>
   </p>
 </div>
 </div>
+`