nitro-web 0.2.10 → 0.2.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitro-web",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "repository": "github:boycce/nitro-web",
5
5
  "homepage": "https://boycce.github.io/nitro-web/",
6
6
  "description": "Nitro is a battle-tested, modular base project to turbocharge your projects, styled using Tailwind 🚀",
@@ -72,12 +72,17 @@ export async function sendEmail({
72
72
  from = from || config.emailFrom
73
73
  replyTo = replyTo || config.emailReplyTo || from
74
74
 
75
+ const defaultData = {
76
+ configName: ucFirst(config.name),
77
+ domain: config.baseUrl,
78
+ replyToEmail: getNameEmail(replyTo)[1],
79
+ replyToName: getNameEmail(replyTo)[0],
80
+ ...(data || {}),
81
+ }
82
+
75
83
  if (swigData) {
76
84
  swigData = {
77
- configName: ucFirst(config.name),
78
- domain: config.baseUrl,
79
- replyToEmail: getNameEmail(replyTo)[1],
80
- replyToName: getNameEmail(replyTo)[0],
85
+ ...defaultData,
81
86
  ...swigData,
82
87
  }
83
88
  }
@@ -91,11 +96,7 @@ export async function sendEmail({
91
96
  for (let toNameEmail of toSplit) {
92
97
  const [toName, toEmail] = getNameEmail(toNameEmail)
93
98
  recipientVariables[toEmail] = {
94
- configName: ucFirst(config.name),
95
- domain: config.baseUrl,
96
- replyToEmail: getNameEmail(replyTo)[1],
97
- replyToName: getNameEmail(replyTo)[0],
98
- ...(data || {}),
99
+ ...defaultData,
99
100
  email: toEmail,
100
101
  greet: toName ? 'Hi ' + toName : 'Hello',
101
102
  name: toName,
@@ -115,7 +116,6 @@ export async function sendEmail({
115
116
  template: template,
116
117
  test: isTest,
117
118
  to: to,
118
- url: config.baseUrl,
119
119
  swigData: swigData,
120
120
  }
121
121