Skip to content

Commit

Permalink
feat: added bcc email validation with otp code (#93)
Browse files Browse the repository at this point in the history
* feat: added bcc email validation with otp code

* fix: locales and otp widget

* fix: form response

* feat: disable otp send button for 5 minutes

* fix: display seconds

* chore: updated README
  • Loading branch information
giuliaghisini authored Apr 18, 2024
1 parent 22a026f commit e2100be
Show file tree
Hide file tree
Showing 23 changed files with 822 additions and 88 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ With HCaptcha integration, you also have an additional option in the sidebar in

In some test scenarios it's found that the "Passing Threshold" of HCaptcha must be configured as "Auto" to get the best results. In some test cases if one sets the Threshold to "Moderate" HCaptcha starts to fail.

### OTP email validation

To prevent sending spam emails to users via the email address configured as sender, the 'email' fields type flagged as BCC will require the user to enter an OTP code received at the address entered in the field when user fills out the form.

## Export

With backend support, you can store data submitted from the form.
Expand Down
33 changes: 29 additions & 4 deletions locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,12 @@ msgstr "Daten exportieren"
msgid "form_edit_fill_required_configuration_fields"
msgstr ""

#: index
#: helpers/validators
# defaultMessage: The e-mail entered in the 'From' field must be a valid e-mail address.
msgid "form_edit_invalid_from_email"
msgstr ""

#: index
#: helpers/validators
# defaultMessage: The e-mail entered in the 'Receipients' field must be a valid e-mail address.
msgid "form_edit_invalid_to_email"
msgstr ""
Expand Down Expand Up @@ -424,11 +424,26 @@ msgstr "Textfeld"
msgid "form_formDataCount"
msgstr "{formDataCount} Element(e) gespeichert"

#: components/Widget/OTPWidget
# defaultMessage: Insert here the OTP code received at {email}
msgid "form_insert_otp"
msgstr ""

#: formSchema
# defaultMessage: Manage data
msgid "form_manage_data"
msgstr ""

#: components/Widget/OTPWidget
# defaultMessage: You can send a new OTP code in
msgid "form_otp_countdown"
msgstr ""

#: components/Widget/OTPWidget
# defaultMessage: OTP code was sent to {email}. Check your email and insert the received OTP code into the field above.
msgid "form_otp_send"
msgstr ""

#: formSchema
# defaultMessage: Data wipe
msgid "form_remove_data_after_days"
Expand All @@ -439,7 +454,7 @@ msgstr ""
msgid "form_remove_data_after_days_helptext"
msgstr ""

#: components/FormView
#: components/FormResult
# defaultMessage: Clear
msgid "form_reset"
msgstr "Löschen"
Expand Down Expand Up @@ -469,6 +484,11 @@ msgstr ""
msgid "form_send_message_helptext"
msgstr ""

#: components/Widget/OTPWidget
# defaultMessage: Send OTP code to {email}
msgid "form_send_otp_to"
msgstr ""

#: formSchema
# defaultMessage: Show cancel button
msgid "form_show_cancel"
Expand All @@ -479,7 +499,7 @@ msgstr ""
msgid "form_submit_label"
msgstr "Beschriftung der Schaltfläche Senden"

#: components/FormView
#: components/FormResult
# defaultMessage: Sent!
msgid "form_submit_success"
msgstr "Gesendet!"
Expand Down Expand Up @@ -514,6 +534,11 @@ msgstr "Setzt diese Adresse als Antwortadresse in versendeten Mails"
msgid "formblock_defaultInvalidFieldMessage"
msgstr ""

#: components/View
# defaultMessage: Please, insert the OTP code recived via email.
msgid "formblock_insertOtp_error"
msgstr ""

#: components/View
# defaultMessage: The email is incorrect
msgid "formblock_invalidEmailMessage"
Expand Down
33 changes: 29 additions & 4 deletions locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,12 @@ msgstr "Export in CSV"
msgid "form_edit_fill_required_configuration_fields"
msgstr ""

#: index
#: helpers/validators
# defaultMessage: The e-mail entered in the 'From' field must be a valid e-mail address.
msgid "form_edit_invalid_from_email"
msgstr ""

#: index
#: helpers/validators
# defaultMessage: The e-mail entered in the 'Receipients' field must be a valid e-mail address.
msgid "form_edit_invalid_to_email"
msgstr ""
Expand Down Expand Up @@ -424,11 +424,26 @@ msgstr "Textarea"
msgid "form_formDataCount"
msgstr "{formDataCount} item(s) stored"

#: components/Widget/OTPWidget
# defaultMessage: Insert here the OTP code received at {email}
msgid "form_insert_otp"
msgstr ""

#: formSchema
# defaultMessage: Manage data
msgid "form_manage_data"
msgstr ""

#: components/Widget/OTPWidget
# defaultMessage: You can send a new OTP code in
msgid "form_otp_countdown"
msgstr ""

#: components/Widget/OTPWidget
# defaultMessage: OTP code was sent to {email}. Check your email and insert the received OTP code into the field above.
msgid "form_otp_send"
msgstr ""

#: formSchema
# defaultMessage: Data wipe
msgid "form_remove_data_after_days"
Expand All @@ -439,7 +454,7 @@ msgstr ""
msgid "form_remove_data_after_days_helptext"
msgstr ""

#: components/FormView
#: components/FormResult
# defaultMessage: Clear
msgid "form_reset"
msgstr "Clear"
Expand Down Expand Up @@ -469,6 +484,11 @@ msgstr "Message of sending confirmed"
msgid "form_send_message_helptext"
msgstr "You can add the value of a filled field in the form by inserting its ID between curly brackets preceded by $, example: ${field_id}; you can add html elements such as links <a>, new line <br />, bold <b> and italic <i> formatting."

#: components/Widget/OTPWidget
# defaultMessage: Send OTP code to {email}
msgid "form_send_otp_to"
msgstr ""

#: formSchema
# defaultMessage: Show cancel button
msgid "form_show_cancel"
Expand All @@ -479,7 +499,7 @@ msgstr "Show cancel button"
msgid "form_submit_label"
msgstr "Submit button label"

#: components/FormView
#: components/FormResult
# defaultMessage: Sent!
msgid "form_submit_success"
msgstr "Sent!"
Expand Down Expand Up @@ -514,6 +534,11 @@ msgstr "If selected, this will be the address the receiver can use to reply."
msgid "formblock_defaultInvalidFieldMessage"
msgstr ""

#: components/View
# defaultMessage: Please, insert the OTP code recived via email.
msgid "formblock_insertOtp_error"
msgstr ""

#: components/View
# defaultMessage: The email is incorrect
msgid "formblock_invalidEmailMessage"
Expand Down
33 changes: 29 additions & 4 deletions locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,12 @@ msgstr "Exportar datos"
msgid "form_edit_fill_required_configuration_fields"
msgstr ""

#: index
#: helpers/validators
# defaultMessage: The e-mail entered in the 'From' field must be a valid e-mail address.
msgid "form_edit_invalid_from_email"
msgstr ""

#: index
#: helpers/validators
# defaultMessage: The e-mail entered in the 'Receipients' field must be a valid e-mail address.
msgid "form_edit_invalid_to_email"
msgstr ""
Expand Down Expand Up @@ -433,11 +433,26 @@ msgstr "Campo de texto"
msgid "form_formDataCount"
msgstr "{formDataCount} elemento(s) guardados"

#: components/Widget/OTPWidget
# defaultMessage: Insert here the OTP code received at {email}
msgid "form_insert_otp"
msgstr ""

#: formSchema
# defaultMessage: Manage data
msgid "form_manage_data"
msgstr ""

#: components/Widget/OTPWidget
# defaultMessage: You can send a new OTP code in
msgid "form_otp_countdown"
msgstr ""

#: components/Widget/OTPWidget
# defaultMessage: OTP code was sent to {email}. Check your email and insert the received OTP code into the field above.
msgid "form_otp_send"
msgstr ""

#: formSchema
# defaultMessage: Data wipe
msgid "form_remove_data_after_days"
Expand All @@ -448,7 +463,7 @@ msgstr ""
msgid "form_remove_data_after_days_helptext"
msgstr ""

#: components/FormView
#: components/FormResult
# defaultMessage: Clear
msgid "form_reset"
msgstr "Borrar"
Expand Down Expand Up @@ -478,6 +493,11 @@ msgstr ""
msgid "form_send_message_helptext"
msgstr ""

#: components/Widget/OTPWidget
# defaultMessage: Send OTP code to {email}
msgid "form_send_otp_to"
msgstr ""

#: formSchema
# defaultMessage: Show cancel button
msgid "form_show_cancel"
Expand All @@ -488,7 +508,7 @@ msgstr ""
msgid "form_submit_label"
msgstr "Etiqueta del botón de envío"

#: components/FormView
#: components/FormResult
# defaultMessage: Sent!
msgid "form_submit_success"
msgstr "Enviado"
Expand Down Expand Up @@ -523,6 +543,11 @@ msgstr "Si está seleccionado el valor de este campo se utilizará como cabecera
msgid "formblock_defaultInvalidFieldMessage"
msgstr ""

#: components/View
# defaultMessage: Please, insert the OTP code recived via email.
msgid "formblock_insertOtp_error"
msgstr ""

#: components/View
# defaultMessage: The email is incorrect
msgid "formblock_invalidEmailMessage"
Expand Down
33 changes: 29 additions & 4 deletions locales/eu/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,12 @@ msgstr "Esportatu datuak"
msgid "form_edit_fill_required_configuration_fields"
msgstr ""

#: index
#: helpers/validators
# defaultMessage: The e-mail entered in the 'From' field must be a valid e-mail address.
msgid "form_edit_invalid_from_email"
msgstr ""

#: index
#: helpers/validators
# defaultMessage: The e-mail entered in the 'Receipients' field must be a valid e-mail address.
msgid "form_edit_invalid_to_email"
msgstr ""
Expand Down Expand Up @@ -426,11 +426,26 @@ msgstr "Testua"
msgid "form_formDataCount"
msgstr "Gordetako elementu kopurua: {formDataCount}"

#: components/Widget/OTPWidget
# defaultMessage: Insert here the OTP code received at {email}
msgid "form_insert_otp"
msgstr ""

#: formSchema
# defaultMessage: Manage data
msgid "form_manage_data"
msgstr ""

#: components/Widget/OTPWidget
# defaultMessage: You can send a new OTP code in
msgid "form_otp_countdown"
msgstr ""

#: components/Widget/OTPWidget
# defaultMessage: OTP code was sent to {email}. Check your email and insert the received OTP code into the field above.
msgid "form_otp_send"
msgstr ""

#: formSchema
# defaultMessage: Data wipe
msgid "form_remove_data_after_days"
Expand All @@ -441,7 +456,7 @@ msgstr ""
msgid "form_remove_data_after_days_helptext"
msgstr ""

#: components/FormView
#: components/FormResult
# defaultMessage: Clear
msgid "form_reset"
msgstr "Garbitu"
Expand Down Expand Up @@ -471,6 +486,11 @@ msgstr ""
msgid "form_send_message_helptext"
msgstr ""

#: components/Widget/OTPWidget
# defaultMessage: Send OTP code to {email}
msgid "form_send_otp_to"
msgstr ""

#: formSchema
# defaultMessage: Show cancel button
msgid "form_show_cancel"
Expand All @@ -481,7 +501,7 @@ msgstr ""
msgid "form_submit_label"
msgstr "Bidalketa botoiaren etiketa"

#: components/FormView
#: components/FormResult
# defaultMessage: Sent!
msgid "form_submit_success"
msgstr "Bidalita!"
Expand Down Expand Up @@ -516,6 +536,11 @@ msgstr "Aukeratuz gero jasotako posta elektronikoari 'Erantzun' eginez gero erem
msgid "formblock_defaultInvalidFieldMessage"
msgstr ""

#: components/View
# defaultMessage: Please, insert the OTP code recived via email.
msgid "formblock_insertOtp_error"
msgstr ""

#: components/View
# defaultMessage: The email is incorrect
msgid "formblock_invalidEmailMessage"
Expand Down
Loading

0 comments on commit e2100be

Please sign in to comment.