-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4971 from open-formulieren/feature/4650-set-submi…
…ssion-email-address-using-url-parameters Dynamic email registration recipients using variables
- Loading branch information
Showing
24 changed files
with
905 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...js/components/admin/form_design/registrations/email/fields/EmailRecipientsFromVariable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import {useField} from 'formik'; | ||
import React from 'react'; | ||
import {FormattedMessage} from 'react-intl'; | ||
|
||
import Field from 'components/admin/forms/Field'; | ||
import FormRow from 'components/admin/forms/FormRow'; | ||
import VariableSelection from 'components/admin/forms/VariableSelection'; | ||
|
||
const EmailRecipientsFromVariable = () => { | ||
const [fieldProps, , {setValue}] = useField('toEmailsFromVariable'); | ||
return ( | ||
<FormRow> | ||
<Field | ||
name="toEmailsFromVariable" | ||
label={ | ||
<FormattedMessage | ||
description="Email registration options 'toEmailsFromVariable' label" | ||
defaultMessage="Variable containing email addresses" | ||
/> | ||
} | ||
helpText={ | ||
<FormattedMessage | ||
description="Email registration options 'toEmailsFromVariable' helpText" | ||
defaultMessage={`If specified, the recipient email addresses will be taken | ||
from the selected variable. You must still specify 'regular' email addresses | ||
as a fallback, in case something is wrong with the variable. | ||
`} | ||
/> | ||
} | ||
> | ||
<VariableSelection | ||
{...fieldProps} | ||
isClearable | ||
onChange={event => { | ||
const newValue = event.target.value; | ||
setValue(newValue == null ? '' : newValue); | ||
}} | ||
filter={variable => ['string', 'array'].includes(variable.dataType)} | ||
/> | ||
</Field> | ||
</FormRow> | ||
); | ||
}; | ||
|
||
EmailRecipientsFromVariable.propTypes = {}; | ||
|
||
export default EmailRecipientsFromVariable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.