Browse Source

fix(scheduler): importing email contents

Karol Sójko 2 years ago
parent
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 {
   return 'Enable email backups for your account'
 }
 
 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 {
   return 'Checking in after one month with Standard Notes'
 }
 
 export function getBody(registrationDate: string): string {
-  const body = readFileSync(`${__dirname}/encourage-subscription-purchasing.html`).toString()
+  const body = html
 
   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 {
   return 'Can we ask why you canceled?'
 }
 
 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>
     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.
@@ -15,4 +15,4 @@
   <a href="https://standardnotes.com/help/28/how-do-i-enable-daily-email-backups">
     Learn more about daily email backups →
   </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>
     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
     we'd be happy to help.
   </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>
     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.
@@ -26,3 +26,4 @@
     our support team will be in touch with you.
   </p>
 </div>
+`