Skip to content

Commit 5336a42

Browse files
fix(core): escape double quotes in email body and subject
GH-9
1 parent 315d7a5 commit 5336a42

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

projects/workflows-creator/src/lib/builder/group/group.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@ export class GroupComponent<E> implements OnInit, AfterViewInit {
225225
if (allowedInputs.includes(input.getIdentifier())) {
226226
const value = input.getModelValue(nodeWithInput.node.state);
227227
if (nodeWithInput.node.state.get('email')) {
228+
(value as AllowedValuesMap).body = (
229+
(value as AllowedValuesMap).body as string
230+
).replace(/\\"/g, '"');
231+
(value as AllowedValuesMap).subject = (
232+
(value as AllowedValuesMap).subject as string
233+
).replace(/\\"/g, '"');
234+
228235
this.emailInput = value;
229236
} else {
230237
switch (nodeWithInput.node.state.get('valueInputType')) {

projects/workflows-creator/src/lib/classes/nodes/abstract-prompt.class.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ export abstract class WorkflowPrompt {
9494
const dateTime = `${this.onDateSelect(date)} ${hours}:${min}`;
9595
return moment(dateTime.toString(), 'DD-MM-YYYY hh:mm').format();
9696
case InputTypes.Email:
97+
(value as AllowedValuesMap).body = (
98+
(value as AllowedValuesMap).body as string
99+
).replace(/"/g, '\\"');
100+
(value as AllowedValuesMap).subject = (
101+
(value as AllowedValuesMap).subject as string
102+
).replace(/"/g, '\\"');
97103
(value as AllowedValuesMap).displayValue = 'email';
98104
return value;
99105
case InputTypes.Number:

0 commit comments

Comments
 (0)