|
8 | 8 | :attachments="section.email.attachments"
|
9 | 9 | :bcc="section.email.bcc"
|
10 | 10 | :bcc-label="t('email.bcc')"
|
11 |
| - :body="section.email.body" |
12 | 11 | :body-label="t('stageParticipants.notify.message')"
|
13 | 12 | :can-change-recipients="section.email.canChangeRecipients"
|
14 | 13 | :cc="section.email.cc"
|
|
34 | 33 | :remove-item-label="t('common.removeItem')"
|
35 | 34 | :searching-label="t('common.searching')"
|
36 | 35 | :search-results-label="t('search.searchResults')"
|
37 |
| - :subject="section.email.subject" |
38 | 36 | :subject-label="t('email.subject')"
|
39 | 37 | :switch-to-label="t('common.switchTo')"
|
40 | 38 | :switch-to-named-language-label="t('common.switchToNamedItem')"
|
41 | 39 | :variables="section.email.variables"
|
42 |
| - @set="store.updateStep" |
| 40 | + v-bind="emailComposer" |
| 41 | + @set="(componentName, update) => updateEmail(update)" |
43 | 42 | ></composer>
|
44 | 43 | </template>
|
45 | 44 |
|
46 | 45 | <script setup>
|
| 46 | +import {computed} from 'vue'; |
47 | 47 | import Composer from '@/components/Composer/Composer.vue';
|
48 | 48 | import {useTranslation} from '@/composables/useTranslation';
|
49 | 49 | import {defineProps} from 'vue';
|
50 | 50 | import {useUserInvitationPageStore} from './UserInvitationPageStore';
|
51 | 51 |
|
52 |
| -defineProps({ |
| 52 | +const props = defineProps({ |
53 | 53 | section: {type: Object, required: true},
|
54 | 54 | });
|
55 | 55 | const {t} = useTranslation();
|
| 56 | +
|
56 | 57 | const store = useUserInvitationPageStore();
|
| 58 | +const emailComposer = computed(() => store.invitationPayload.emailComposer); |
| 59 | +
|
| 60 | +function updateEmail(update) { |
| 61 | + const emailComposerUpdate = { |
| 62 | + ...store.invitationPayload.emailComposer, |
| 63 | + ...update, |
| 64 | + }; |
| 65 | + store.updatePayload('emailComposer', emailComposerUpdate); |
| 66 | +} |
| 67 | +
|
| 68 | +if (!store.invitationPayload.body) { |
| 69 | + updateEmail({ |
| 70 | + subject: props.section.email.subject, |
| 71 | + body: props.section.email.body, |
| 72 | + }); |
| 73 | +} |
57 | 74 | </script>
|
0 commit comments