feat: fix update email template editor
This commit is contained in:
parent
617dcdde53
commit
8b34e001ef
|
@ -14,13 +14,14 @@ import {
|
||||||
ModalHeader,
|
ModalHeader,
|
||||||
ModalOverlay,
|
ModalOverlay,
|
||||||
Select,
|
Select,
|
||||||
|
Text,
|
||||||
useDisclosure,
|
useDisclosure,
|
||||||
useToast,
|
useToast,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { FaPlus } from 'react-icons/fa';
|
import { FaPlus } from 'react-icons/fa';
|
||||||
import { useClient } from 'urql';
|
import { useClient } from 'urql';
|
||||||
import { Editor } from 'react-draft-wysiwyg';
|
import { Editor } from 'react-draft-wysiwyg';
|
||||||
import { EditorState, convertToRaw } from 'draft-js';
|
import { EditorState, convertToRaw, Modifier } from 'draft-js';
|
||||||
import draftToHtml from 'draftjs-to-html';
|
import draftToHtml from 'draftjs-to-html';
|
||||||
import { stateFromHTML } from 'draft-js-import-html';
|
import { stateFromHTML } from 'draft-js-import-html';
|
||||||
import {
|
import {
|
||||||
|
@ -278,11 +279,17 @@ const UpdateEmailTemplate = ({
|
||||||
</Flex>
|
</Flex>
|
||||||
<Flex
|
<Flex
|
||||||
width="100%"
|
width="100%"
|
||||||
justifyContent="flex-start"
|
justifyContent="space-between"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
marginBottom="2%"
|
marginBottom="2%"
|
||||||
>
|
>
|
||||||
<Flex>Template Body</Flex>
|
<Flex>Template Body</Flex>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontSize: 14,
|
||||||
|
}}
|
||||||
|
color="gray.400"
|
||||||
|
>{`To select dynamic variables open curly braces "{"`}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Editor
|
<Editor
|
||||||
editorState={editorState}
|
editorState={editorState}
|
||||||
|
@ -293,6 +300,24 @@ const UpdateEmailTemplate = ({
|
||||||
marginTop: '2%',
|
marginTop: '2%',
|
||||||
height: '35vh',
|
height: '35vh',
|
||||||
}}
|
}}
|
||||||
|
mention={{
|
||||||
|
separator: ' ',
|
||||||
|
trigger: '{',
|
||||||
|
suggestions: [
|
||||||
|
{
|
||||||
|
text: 'user_name',
|
||||||
|
value: '{user.name}}',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'user_email',
|
||||||
|
value: '{user.email}}',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'org_name',
|
||||||
|
value: '{org.name}}',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
|
|
|
@ -204,3 +204,9 @@ export enum webhookVerifiedStatus {
|
||||||
NOT_VERIFIED = 'not_verified',
|
NOT_VERIFIED = 'not_verified',
|
||||||
PENDING = 'verification_pending',
|
PENDING = 'verification_pending',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const emailTemplateVariables = {
|
||||||
|
user_name: '{{user.name}}',
|
||||||
|
user_email: '{{user.email}}',
|
||||||
|
organization_name: '{{org.name}}',
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user