@dev.smartpricing/message-composer-layer 4.2.3 → 4.2.5

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.
@@ -91,8 +91,13 @@ const defaultSenderEmail = computed(
91
91
  () => composerContext.organizationData?.value?.senderEmail ?? '',
92
92
  )
93
93
 
94
+ const accommodationName = computed(
95
+ () => composerContext.organizationData?.value?.accommodationName ?? '',
96
+ )
97
+
94
98
  const state = ref<Schema>({
95
99
  to: '',
100
+ sender_name: accommodationName.value,
96
101
  from: '',
97
102
  })
98
103
 
@@ -120,6 +125,7 @@ const schema = z.object({
120
125
  },
121
126
  { message: t('editor.validation.error.emailInvalid') },
122
127
  ),
128
+ sender_name: z.string().optional(),
123
129
  from: z.string().refine((value) => !value || isEmail(value), {
124
130
  message: t('editor.validation.error.emailInvalid'),
125
131
  }),
@@ -133,10 +139,12 @@ const resolvedBrandId = computed(
133
139
 
134
140
  function onSubmit() {
135
141
  if (!resolvedMessage.value) return
142
+ const sender_name = state.value.sender_name?.trim()
136
143
  sendTest({
137
144
  message: resolvedMessage.value,
138
145
  to: state.value.to,
139
146
  brand_id: resolvedBrandId.value,
147
+ ...(sender_name ? { sender_name } : {}),
140
148
  from: state.value.from || undefined,
141
149
  })
142
150
  }
@@ -144,6 +152,11 @@ function onSubmit() {
144
152
  const open = defineModel<boolean>('open', { default: false })
145
153
  const formRef = ref()
146
154
 
155
+ // Reset sender name to the accommodation default each time the modal opens
156
+ watch(open, (isOpen) => {
157
+ if (isOpen) state.value.sender_name = accommodationName.value
158
+ })
159
+
147
160
  watch(status, (newStatus) => {
148
161
  if (newStatus === 'success') {
149
162
  const recipients = state.value.to
@@ -201,6 +214,18 @@ watch(status, (newStatus) => {
201
214
  :placeholder="$t('pages.email.test_email_from_placeholder')"
202
215
  />
203
216
  </UFormField>
217
+ <UFormField
218
+ name="sender_name"
219
+ :label="$t('pages.email.sender_name_label')"
220
+ class="mt-4"
221
+ :data-testid="sendTestEmailModalTestIds.senderNameFormField"
222
+ >
223
+ <UInput
224
+ v-model="state.sender_name"
225
+ :placeholder="$t('pages.email.sender_name_placeholder')"
226
+ :data-testid="sendTestEmailModalTestIds.senderNameInput"
227
+ />
228
+ </UFormField>
204
229
  </UForm>
205
230
  </template>
206
231
 
@@ -3,6 +3,8 @@ import type { AppContextConfig } from '@dev.smartpricing/message-composer-utils/
3
3
 
4
4
  export interface OrganizationData {
5
5
  senderEmail: string
6
+ /** Tenant accommodation/property name — defaults the test-email sender name */
7
+ accommodationName?: string
6
8
  }
7
9
 
8
10
  export interface ComposerContext {
@@ -330,6 +330,8 @@ export const sendTestEmailModalTestIds = {
330
330
  triggerButton: 'send-test-email-modal-trigger-button',
331
331
  toFormField: 'send-test-email-modal-to-form-field',
332
332
  toInput: 'send-test-email-modal-to-input',
333
+ senderNameFormField: 'send-test-email-modal-sender-name-form-field',
334
+ senderNameInput: 'send-test-email-modal-sender-name-input',
333
335
  cancelButton: 'send-test-email-modal-cancel-button',
334
336
  sendButton: 'send-test-email-modal-send-button',
335
337
  } as const
@@ -241,6 +241,8 @@ Diese Nachrichten müssen funktional sein, nicht werblich.
241
241
  send_test_success: 'Test-E-Mail erfolgreich gesendet.',
242
242
  test_email_to: 'An',
243
243
  test_email_to_placeholder: 'Empfänger-E-Mail(s), getrennt durch ;',
244
+ sender_name_label: 'Absendername',
245
+ sender_name_placeholder: 'Absendername',
244
246
  test_email_from: 'Von',
245
247
  test_email_from_placeholder: 'Absender-E-Mail-Adresse',
246
248
  create_message_group: {
@@ -238,6 +238,8 @@ These messages must be functional, not promotional.
238
238
  send_test_success: 'Test email sent successfully.',
239
239
  test_email_to: 'To',
240
240
  test_email_to_placeholder: 'Recipient email(s), separated by ;',
241
+ sender_name_label: 'Sender name',
242
+ sender_name_placeholder: 'Sender name',
241
243
  test_email_from: 'From',
242
244
  test_email_from_placeholder: 'Sender email address',
243
245
  create_message_group: {
@@ -238,6 +238,8 @@ Estos mensajes deben ser funcionales, no promocionales.
238
238
  send_test_success: 'Correo de prueba enviado correctamente.',
239
239
  test_email_to: 'Para',
240
240
  test_email_to_placeholder: 'Correo(s) del destinatario, separados por ;',
241
+ sender_name_label: 'Nombre del remitente',
242
+ sender_name_placeholder: 'Nombre del remitente',
241
243
  test_email_from: 'De',
242
244
  test_email_from_placeholder: 'Dirección de email del remitente',
243
245
  create_message_group: {
@@ -238,6 +238,8 @@ Ces messages doivent être fonctionnels, et non promotionnels.
238
238
  send_test_success: 'E-mail de test envoyé avec succès.',
239
239
  test_email_to: 'À',
240
240
  test_email_to_placeholder: 'E-mail(s) du/des destinataire(s), séparé(s) par ;',
241
+ sender_name_label: 'Nom de l\'expéditeur',
242
+ sender_name_placeholder: 'Nom de l\'expéditeur',
241
243
  test_email_from: 'De',
242
244
  test_email_from_placeholder: "Adresse e-mail de l'expéditeur",
243
245
  create_message_group: {
@@ -238,6 +238,8 @@ Questi messaggi devono essere funzionali, non promozionali.
238
238
  send_test_success: 'Email di test inviata con successo.',
239
239
  test_email_to: 'A',
240
240
  test_email_to_placeholder: 'Email destinatario/i, separate da ;',
241
+ sender_name_label: 'Nome mittente',
242
+ sender_name_placeholder: 'Nome mittente',
241
243
  test_email_from: 'Da',
242
244
  test_email_from_placeholder: 'Indirizzo email mittente',
243
245
  create_message_group: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev.smartpricing/message-composer-layer",
3
- "version": "4.2.3",
3
+ "version": "4.2.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -36,7 +36,7 @@
36
36
  "vue-router": "^5.0.7",
37
37
  "vue3-emoji-picker": "^1.1.8",
38
38
  "zod": "^4.4.3",
39
- "@dev.smartpricing/message-composer-utils": "4.2.3"
39
+ "@dev.smartpricing/message-composer-utils": "4.2.5"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@nuxt/eslint": "^1.15.2",