@splendidlabz/third-party 1.2.0 → 1.3.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @splendidlabz/third-party
2
2
 
3
+ ## 1.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Many changes! Woo
8
+
9
+ ### Patch Changes
10
+
11
+ - 5114274: Sendy: Include prettyName option
12
+ - Updated dependencies [2c149fc]
13
+ - Updated dependencies
14
+ - @splendidlabz/utils@1.7.0
15
+
3
16
  ## 1.2.0
4
17
 
5
18
  ### Minor Changes
package/lib/sendy.js CHANGED
@@ -16,6 +16,7 @@ export function createSendy({
16
16
  apiKey,
17
17
  getReferrer = null,
18
18
  getIpAddress = null,
19
+ prettyName = true,
19
20
  } = {}) {
20
21
  const api_key = apiKey
21
22
  const list = listId
@@ -69,6 +70,7 @@ export function createSendy({
69
70
  async subscribe({
70
71
  context,
71
72
  email,
73
+ name,
72
74
  listId,
73
75
  gdpr = false,
74
76
  silent = false,
@@ -77,6 +79,17 @@ export function createSendy({
77
79
  const ip = getIpAddress && context && getIpAddress(context)
78
80
  const referrer = getReferrer && context && getReferrer(context)
79
81
 
82
+ // Potentially add country and city based on ip address...
83
+ // Via ipapi.co - Free for 30,000 requests per month
84
+
85
+ if (name && prettyName) {
86
+ name = name
87
+ .toLowerCase()
88
+ .split(' ')
89
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1))
90
+ .join(' ')
91
+ }
92
+
80
93
  const body = omitEmpty({
81
94
  boolean: true,
82
95
  api_key,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@splendidlabz/third-party",
3
3
  "prettier": "@splendidlabz/prettier-config",
4
- "version": "1.2.0",
4
+ "version": "1.3.0",
5
5
  "description": "",
6
6
  "type": "module",
7
7
  "main": "index.js",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "author": "Zell Liew <zellwk@gmail.com>",
18
18
  "dependencies": {
19
- "@splendidlabz/utils": "1.6.0",
19
+ "@splendidlabz/utils": "1.7.0",
20
20
  "googleapis": "^148.0.0",
21
21
  "http-errors": "^2.0.0",
22
22
  "pino": "^9.7.0",