@asd20/ui-next 2.0.27 → 2.0.28

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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.28](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.0.27...ui-next-v2.0.28) (2026-04-03)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * reinstall send an email functionality ([202c86b](https://github.com/academydistrict20/asd20-ui-next/commit/202c86b028e15121d83484de3fa280770448c46b))
9
+
3
10
  ## [2.0.27](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.0.26...ui-next-v2.0.27) (2026-04-03)
4
11
 
5
12
  ## [2.0.26](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.0.25...ui-next-v2.0.26) (2026-04-03)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asd20/ui-next",
3
- "version": "2.0.27",
3
+ "version": "2.0.28",
4
4
  "private": false,
5
5
  "description": "ASD20 UI component library for Vue 3.",
6
6
  "license": "MIT",
@@ -62,6 +62,7 @@ import Asd20Viewport from '../../atoms/Asd20Viewport'
62
62
  import Asd20Spinner from '../../atoms/Asd20Spinner'
63
63
  import Asd20Button from '../../atoms/Asd20Button'
64
64
  import Recaptcha from '../../utils/Recaptcha'
65
+ import sendEmail from '../../../helpers/sendEmail.js'
65
66
 
66
67
  export default {
67
68
  name: 'Asd20ComposeEmailModal',
@@ -102,6 +103,31 @@ export default {
102
103
  },
103
104
  },
104
105
  methods: {
106
+ resolveRuntimeConfig() {
107
+ const runtimeConfig =
108
+ this.$config ||
109
+ this.$?.appContext?.config?.globalProperties?.$config ||
110
+ {}
111
+
112
+ if (
113
+ runtimeConfig.public &&
114
+ typeof runtimeConfig.public === 'object' &&
115
+ !Array.isArray(runtimeConfig.public)
116
+ ) {
117
+ return runtimeConfig.public
118
+ }
119
+
120
+ return runtimeConfig
121
+ },
122
+ resolveSendEmailEndpoint() {
123
+ const runtimeConfig = this.resolveRuntimeConfig()
124
+
125
+ return (
126
+ runtimeConfig.sendEmailEndpoint ||
127
+ runtimeConfig.azureSendEmailEndpoint ||
128
+ null
129
+ )
130
+ },
105
131
  validateEmailAddress({ value, validationErrors }) {
106
132
  const pattern = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
107
133
  const regex = RegExp(pattern)
@@ -124,13 +150,39 @@ export default {
124
150
  if (response) this.sendEmail()
125
151
  },
126
152
  async sendEmail() {
127
- if (!this.isValid || !this.$sendEmail) return
153
+ if (!this.isValid) return
154
+
155
+ const endpoint = this.resolveSendEmailEndpoint()
156
+ const sendEmailClient =
157
+ this.$sendEmail ||
158
+ (endpoint
159
+ ? async (message) => await sendEmail(message, endpoint)
160
+ : null)
161
+
162
+ if (!sendEmailClient) {
163
+ console.error('Send email endpoint is not configured.')
164
+ alert(
165
+ 'Email sending is not configured for this environment. Please try again later.'
166
+ )
167
+ return
168
+ }
169
+
128
170
  this.sending = true
129
- await this.$sendEmail(
130
- Object.assign({}, this.emailMessage, { recipientId: this.recipientId })
131
- )
132
- this.sending = false
133
- this.$emit('dismiss')
171
+ try {
172
+ await sendEmailClient(
173
+ Object.assign({}, this.emailMessage, {
174
+ recipientId: this.recipientId,
175
+ })
176
+ )
177
+ this.$emit('dismiss')
178
+ } catch (error) {
179
+ console.error('Email send failed:', error?.message || error)
180
+ alert(
181
+ 'Something went wrong while sending your email. Please try again later.'
182
+ )
183
+ } finally {
184
+ this.sending = false
185
+ }
134
186
  },
135
187
  },
136
188
  }