Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Send email feature from form using conditional variable field

Avatar

Level 1
 

SendEmail.pngI'm wondering if it's possible to set up a conditional variable for a send email CC. I have a text field set to populate the CC field. But I need for that field to be nullable. It can't be a required field, because it is an option for the end user. Currently, the form will not submit unless that text field contains an email address. 

 

Any thoughts on how to make this conditional? Thanks. 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Instead of null try to send a dummy email as CC. In case user doesn't enter anything default it to dummy email.

 

Thanks,

Mayank

View solution in original post

3 Replies

Avatar

Correct answer by
Employee Advisor

Instead of null try to send a dummy email as CC. In case user doesn't enter anything default it to dummy email.

 

Thanks,

Mayank

Avatar

Level 1
Thanks, Mayank. That's what I went with as a work-around. I was hoping there would be something cleaner, but that should be fine.