@live-change/email-service 0.9.35 → 0.9.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/browser.js CHANGED
@@ -14,6 +14,8 @@ import dns from "dns/promises"
14
14
  const browserQueue = new PQueue({ concurrency: config.browser.concurrency })
15
15
 
16
16
  async function newBrowser() {
17
+ console.log("New browser", config)
18
+ //process.exit(0)
17
19
  if(config.browser.webSocketDebuggerUrl) {
18
20
  const browser = await chromium.connect({ wsEndpoint: config.browser.webSocketDebuggerUrl })
19
21
  return browser
package/config.js CHANGED
@@ -24,11 +24,6 @@ const browser = {
24
24
  null,
25
25
  crypto.randomBytes(24).toString('hex')
26
26
  ),
27
- ssrUrl: getValue(
28
- definition.config.browser?.ssrUrl,
29
- process.env.SSR_URL,
30
- 'http://localhost:8001'
31
- ),
32
27
  }
33
28
 
34
29
  // SMTP configuration
@@ -48,6 +43,15 @@ const renderMethod = getValue(definition.config.renderMethod, process.env.EMAIL_
48
43
 
49
44
  definition.clientConfig = {}
50
45
 
51
- const config = { browser, smtp, renderMethod }
46
+ const config = {
47
+ browser,
48
+ smtp,
49
+ renderMethod,
50
+ ssrUrl: getValue(
51
+ definition.config.browser?.ssrUrl,
52
+ process.env.SSR_URL,
53
+ 'http://localhost:8001'
54
+ )
55
+ }
52
56
 
53
57
  export default config
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/email-service",
3
- "version": "0.9.35",
3
+ "version": "0.9.37",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,7 +21,7 @@
21
21
  "url": "https://www.viamage.com/"
22
22
  },
23
23
  "dependencies": {
24
- "@live-change/framework": "^0.9.35",
24
+ "@live-change/framework": "^0.9.37",
25
25
  "got": "^11.8.6",
26
26
  "html-to-text": "8.1.0",
27
27
  "inline-css": "4.0.2",
@@ -32,6 +32,6 @@
32
32
  "postcss-calc": "10.1.1",
33
33
  "postcss-custom-properties": "14.0.4"
34
34
  },
35
- "gitHead": "abe67aa58ccf8246b8b9fde832287b5305480b91",
35
+ "gitHead": "b9c3b08a3e3b9d328d17f806d6a9f5684e63b878",
36
36
  "type": "module"
37
37
  }
package/render.js CHANGED
@@ -9,7 +9,7 @@ import crypto from 'crypto'
9
9
  import { ObservableValue } from '@live-change/dao'
10
10
 
11
11
  import definition from './definition.js'
12
- const config = definition.config
12
+ import config from './config.js'
13
13
 
14
14
  import { runWithBrowser } from './browser.js'
15
15
 
@@ -423,8 +423,8 @@ async function renderEmailWithBrowser(url) {
423
423
  export { renderEmailWithJuice, renderEmailWithBrowser }
424
424
 
425
425
  async function renderEmail(data) {
426
- const baseUrl = `http://${config.ssrHost||process.env.SSR_HOST||'127.0.0.1'}`+
427
- `:${config.ssrPort||process.env.SSR_PORT||'8001'}`
426
+ console.log("RENDER EMAIL WITH CONFIG", config)
427
+ const baseUrl = config.ssrUrl
428
428
 
429
429
  const encodedData = encodeURIComponent(JSON.stringify(data))
430
430
  const url = `${baseUrl}/_email/${data.action}/${data.contact}/${encodedData}`