You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blazor/rich-text-editor/mail-merge.md
+21-16Lines changed: 21 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@ control: RichTextEditor
7
7
documentation: ug
8
8
---
9
9
10
-
# Mail Merge in Blazor Rich Text Editor
10
+
# Mail merge in Blazor Rich Text Editor Control
11
11
12
-
The Mail Merge feature in Blazor Rich Text Editor enables developers to create dynamic, personalized documents by inserting placeholders (merge fields) into the editor content. These placeholders are later replaced with actual data at runtime, making it ideal for generating letters, invoices, and bulk communication templates.
12
+
The Mail merge feature in Blazor Rich Text Editor enables developers to create dynamic, personalized documents by inserting placeholders (merge fields) into the editor content. These placeholders are later replaced with actual data at runtime, making it ideal for generating letters, invoices, and bulk communication templates.
13
13
14
-
## Rendering Custom Toolbar Items
14
+
## Rendering custom toolbar items
15
15
16
16
Custom toolbar items are added using the [RichTextEditorCustomToolbarItems](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorCustomToolbarItems.html) tag. Each item is defined with:
17
17
@@ -46,11 +46,11 @@ Custom toolbar items are added using the [RichTextEditorCustomToolbarItems](http
46
46
{% endhighlight %}
47
47
{% endtabs %}
48
48
49
-
## Populating and Using Insert Field Dropdown
49
+
## Populating and using insert field dropdown
50
50
51
51
The `Insert Field` dropdown in the Rich Text Editor is designed to let users quickly insert predefined merge fields into the editor content. This dropdown is powered by the `SfDropDownButton` control, which uses its [Items](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SplitButtons.SfDropDownButton.html#Syncfusion_Blazor_SplitButtons_SfDropDownButton_Items) property to bind a collection of menu items.
52
52
53
-
### How the Items Property Works
53
+
### How the items property works
54
54
55
55
- The `Items` property accepts a list of [DropDownMenuItem](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SplitButtons.DropDownMenuItem.html) objects.
56
56
- Each item in this list represents a merge field and contains a [Text](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SplitButtons.DropDownMenuItem.html#Syncfusion_Blazor_SplitButtons_DropDownMenuItem_Text) property, which is displayed in the dropdown.
@@ -92,20 +92,22 @@ When the user selects an item from the dropdown:
92
92
- The snippet is inserted at the current cursor position using [ExecuteCommandAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.SfRichTextEditor.html#Syncfusion_Blazor_RichTextEditor_SfRichTextEditor_ExecuteCommandAsync_Syncfusion_Blazor_RichTextEditor_CommandName_System_String_Syncfusion_Blazor_RichTextEditor_ExecuteCommandOption_).
@@ -130,7 +134,7 @@ Mention control enhances usability by enabling inline field suggestions:
130
134
131
135
This feature is ideal for users who prefer keyboard-driven workflows.
132
136
133
-
## Maintaining Cursor Position During Dropdown Operations
137
+
## Maintaining cursor position during dropdown operations
134
138
135
139
When the `Insert Field` dropdown opens, the editor loses its current selection because focus shifts to the popup. To ensure the placeholder is inserted at the correct position:
136
140
@@ -156,7 +160,7 @@ When the `Insert Field` dropdown opens, the editor loses its current selection b
156
160
}
157
161
```
158
162
159
-
## Handling Editor Mode Changes with OnActionComplete
163
+
## Handling editor mode changes with OnActionComplete
160
164
161
165
The [OnActionComplete](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorEvents.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorEvents_OnActionComplete) event fires after specific actions in the RichTextEditor, such as switching between Source Code and Preview modes.
162
166
@@ -183,7 +187,7 @@ The [OnActionComplete](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.R
183
187
184
188
**Why is this important?** This prevents users from triggering merge operations or inserting fields while editing raw HTML, which could cause unexpected behavior.
185
189
186
-
## Executing Merge Data Action
190
+
## Executing merge data action
187
191
188
192
When the `Merge Data` button is clicked:
189
193
@@ -192,7 +196,7 @@ When the `Merge Data` button is clicked:
192
196
- Each placeholder is replaced with its corresponding value from a dictionary.
193
197
194
198
```csharp
195
-
199
+
{%raw%}
196
200
publicvoidOnClickHandler()
197
201
{
198
202
if (this._mailMergeEditor!=null)
@@ -202,15 +206,16 @@ When the `Merge Data` button is clicked:
0 commit comments