diff --git a/docs/manual/templates.rst b/docs/manual/templates.rst index d8afa544a2..0ac9f4f5e0 100644 --- a/docs/manual/templates.rst +++ b/docs/manual/templates.rst @@ -579,6 +579,7 @@ formulier ingevuld heeft de relevante informatie handmatig zal doorgeven. Variabele Beschrijving ================================== =========================================================================== ``{{ form_name }}`` De naam van het formulier. +``{{ submission_date }}`` De datum waarop het formulier is verzonden. ``{{ form_url }}`` De directe link naar het formulier. ``{{ code }}`` De code om de inzending mee op te halen. ================================== =========================================================================== @@ -592,41 +593,54 @@ Voorbeeld .. code:: django -
Dit is een verzoek om het formulier "{{ form_name }}" mede te ondertekenen.
+Beste lezer,
- Gelieve het formulier te openen met de volgende link: - {{ form_url }}. + Via de website heeft iemand het formulier "{{ form_name }}" + op {{ submission_date }} ingediend. Deze is nog + niet compleet zonder je handtekening.
+
- Daarna word je doorgestuurd naar een pagina waar je moet inloggen. Nadat je
- bent ingelogd, haal je het formulier op met de volgende code:
-
-
- {{ code }}
+ Via deze link kun je inloggen om het formulier te ondertekenen. Daarna nemen wij de
+ aanvraag in behandeling.
+ {{ form_url }} +
+ +Je referentienummer is {{ code }}.
+ + .. tab:: Weergave (impressie) .. code:: html -Dit is een verzoek om het formulier "Voorbeeld" mede te ondertekenen.
+Beste lezer,
- Gelieve het formulier te openen met de volgende link: - https://example.com/voorbeeld-formulier. + Via de website heeft iemand het formulier "Voorbeeld" op 5 december 2024 ingediend. + Deze is nog niet compleet zonder je handtekening. +
+ ++ Via deze link kun je inloggen om het formulier te ondertekenen. Daarna nemen wij de + aanvraag in behandeling.
- Daarna word je doorgestuurd naar een pagina waar je moet inloggen. Nadat je
- bent ingelogd, haal je het formulier op met de volgende code:
-
-
- OF-123456
+ https://example.com/voorbeeld-formulier
Je referentienummer is OF-12345.
+ + .. _objecten_api_registratie: Objecten API registratie diff --git a/src/openapi.yaml b/src/openapi.yaml index 79ca3990c2..813ad744e0 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -1340,7 +1340,6 @@ paths: - `askStatementOfTruth` - `submissionsRemovalOptions` - `confirmationEmailTemplate` - - `sendConfirmationEmail` - `displayMainWebsiteLink` - `includeConfirmationPageContentInPdf` - `translations` @@ -1412,7 +1411,6 @@ paths: - `askStatementOfTruth` - `submissionsRemovalOptions` - `confirmationEmailTemplate` - - `sendConfirmationEmail` - `displayMainWebsiteLink` - `includeConfirmationPageContentInPdf` - `translations` @@ -1928,7 +1926,6 @@ paths: - `askStatementOfTruth` - `submissionsRemovalOptions` - `confirmationEmailTemplate` - - `sendConfirmationEmail` - `displayMainWebsiteLink` - `includeConfirmationPageContentInPdf` - `translations` @@ -2006,7 +2003,6 @@ paths: - `askStatementOfTruth` - `submissionsRemovalOptions` - `confirmationEmailTemplate` - - `sendConfirmationEmail` - `displayMainWebsiteLink` - `includeConfirmationPageContentInPdf` - `translations` @@ -2088,7 +2084,6 @@ paths: - `askStatementOfTruth` - `submissionsRemovalOptions` - `confirmationEmailTemplate` - - `sendConfirmationEmail` - `displayMainWebsiteLink` - `includeConfirmationPageContentInPdf` - `translations` @@ -7512,7 +7507,7 @@ components: Note that this schema is used for both non-admin users filling out forms and admin users designing forms. The fields that are only relevant for admin users are: - `internalName`, `registrationBackends`, `authenticationBackendOptions`, `paymentBackend`, `paymentBackendOptions`, `priceVariableKey`, `product`, `category`, `theme`, `activateOn`, `deactivateOn`, `isDeleted`, `submissionConfirmationTemplate`, `askPrivacyConsent`, `askStatementOfTruth`, `submissionsRemovalOptions`, `confirmationEmailTemplate`, `sendConfirmationEmail`, `displayMainWebsiteLink`, `includeConfirmationPageContentInPdf`, `translations`, `brpPersonenRequestOptions`. + `internalName`, `registrationBackends`, `authenticationBackendOptions`, `paymentBackend`, `paymentBackendOptions`, `priceVariableKey`, `product`, `category`, `theme`, `activateOn`, `deactivateOn`, `isDeleted`, `submissionConfirmationTemplate`, `askPrivacyConsent`, `askStatementOfTruth`, `submissionsRemovalOptions`, `confirmationEmailTemplate`, `displayMainWebsiteLink`, `includeConfirmationPageContentInPdf`, `translations`, `brpPersonenRequestOptions`. properties: uuid: type: string @@ -8019,7 +8014,7 @@ components: Note that this schema is used for both non-admin users filling out forms and admin users designing forms. The fields that are only relevant for admin users are: - `internalName`, `registrationBackends`, `authenticationBackendOptions`, `paymentBackend`, `paymentBackendOptions`, `priceVariableKey`, `product`, `category`, `theme`, `activateOn`, `deactivateOn`, `isDeleted`, `submissionConfirmationTemplate`, `askPrivacyConsent`, `askStatementOfTruth`, `submissionsRemovalOptions`, `confirmationEmailTemplate`, `sendConfirmationEmail`, `displayMainWebsiteLink`, `includeConfirmationPageContentInPdf`, `translations`, `brpPersonenRequestOptions`. + `internalName`, `registrationBackends`, `authenticationBackendOptions`, `paymentBackend`, `paymentBackendOptions`, `priceVariableKey`, `product`, `category`, `theme`, `activateOn`, `deactivateOn`, `isDeleted`, `submissionConfirmationTemplate`, `askPrivacyConsent`, `askStatementOfTruth`, `submissionsRemovalOptions`, `confirmationEmailTemplate`, `displayMainWebsiteLink`, `includeConfirmationPageContentInPdf`, `translations`, `brpPersonenRequestOptions`. properties: name: type: string @@ -8190,7 +8185,7 @@ components: Note that this schema is used for both non-admin users filling out forms and admin users designing forms. The fields that are only relevant for admin users are: - `internalName`, `registrationBackends`, `authenticationBackendOptions`, `paymentBackend`, `paymentBackendOptions`, `priceVariableKey`, `product`, `category`, `theme`, `activateOn`, `deactivateOn`, `isDeleted`, `submissionConfirmationTemplate`, `askPrivacyConsent`, `askStatementOfTruth`, `submissionsRemovalOptions`, `confirmationEmailTemplate`, `sendConfirmationEmail`, `displayMainWebsiteLink`, `includeConfirmationPageContentInPdf`, `translations`, `brpPersonenRequestOptions`. + `internalName`, `registrationBackends`, `authenticationBackendOptions`, `paymentBackend`, `paymentBackendOptions`, `priceVariableKey`, `product`, `category`, `theme`, `activateOn`, `deactivateOn`, `isDeleted`, `submissionConfirmationTemplate`, `askPrivacyConsent`, `askStatementOfTruth`, `submissionsRemovalOptions`, `confirmationEmailTemplate`, `displayMainWebsiteLink`, `includeConfirmationPageContentInPdf`, `translations`, `brpPersonenRequestOptions`. properties: name: type: string @@ -9124,7 +9119,7 @@ components: Note that this schema is used for both non-admin users filling out forms and admin users designing forms. The fields that are only relevant for admin users are: - `internalName`, `registrationBackends`, `authenticationBackendOptions`, `paymentBackend`, `paymentBackendOptions`, `priceVariableKey`, `product`, `category`, `theme`, `activateOn`, `deactivateOn`, `isDeleted`, `submissionConfirmationTemplate`, `askPrivacyConsent`, `askStatementOfTruth`, `submissionsRemovalOptions`, `confirmationEmailTemplate`, `sendConfirmationEmail`, `displayMainWebsiteLink`, `includeConfirmationPageContentInPdf`, `translations`, `brpPersonenRequestOptions`. + `internalName`, `registrationBackends`, `authenticationBackendOptions`, `paymentBackend`, `paymentBackendOptions`, `priceVariableKey`, `product`, `category`, `theme`, `activateOn`, `deactivateOn`, `isDeleted`, `submissionConfirmationTemplate`, `askPrivacyConsent`, `askStatementOfTruth`, `submissionsRemovalOptions`, `confirmationEmailTemplate`, `displayMainWebsiteLink`, `includeConfirmationPageContentInPdf`, `translations`, `brpPersonenRequestOptions`. properties: uuid: type: string diff --git a/src/openforms/conf/locale/nl/LC_MESSAGES/django.po b/src/openforms/conf/locale/nl/LC_MESSAGES/django.po index 09d8725d84..2833b36a78 100644 --- a/src/openforms/conf/locale/nl/LC_MESSAGES/django.po +++ b/src/openforms/conf/locale/nl/LC_MESSAGES/django.po @@ -4,8 +4,8 @@ msgid "" msgstr "" "Project-Id-Version: Open Forms\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-02 14:39+0100\n" -"PO-Revision-Date: 2024-11-26 14:39+0100\n" +"POT-Creation-Date: 2024-12-05 16:01+0100\n" +"PO-Revision-Date: 2024-12-05 16:03+0100\n" "Last-Translator: Sergei MaertensDear reader,
\n" "\n" -"Gelieve naar de formulierpagina te navigeren met de volgende link: %(tt_openvariable)s form_url %(tt_closevariable)s" -"a>.\n" - -#: openforms/emails/templates/emails/co_sign/request.html:13 -#, python-format -msgid "" +"\n" +"Someone submitted the form \"%(tt_openvariable)s form_name %(tt_closevariable)s\"\n" +"via the website on %(tt_openvariable)s submission_date %(tt_closevariable)s. This\n" +"submission is not complete yet without your signature.\n" +"
\n" "\n" -"This is a request to co-sign form \"%(tt_openvariable)s form_name " -"%(tt_closevariable)s\".
\n" +"%(instruction)s
\n" +"\n" +"With the link below you can log in and sign the form submission. Then, we will\n" +"process the request.\n" +"
\n" "\n" "\n"
-" You will then be redirected to authenticate yourself. After "
-"authentication, fill in\n"
-" the following code to retrieve the form submission:\n"
-"
\n"
-"
\n"
-" %(tt_openvariable)s code %(tt_closevariable)s\n"
+"%(tt_openvariable)s form_url %(tt_closevariable)s\n"
"
Kind regards,
\n" +"\n" +"Open Forms
\n" msgstr "" "\n" -"Dit is een verzoek om het formulier \\\"%(tt_openvariable)s form_name " -"%(tt_closevariable)s\\\" mede te ondertekenen.
\n" +"Beste lezer,
\n" +"\n" +"\n" +"Via de website heeft iemand het formulier \"%(tt_openvariable)s form_name %(tt_closevariable)s\"\n" +"op %(tt_openvariable)s submission_date %(tt_closevariable)s ingediend. Deze is nog\n" +"niet compleet zonder je handtekening.\n" +"
\n" "\n" -"%(instruction)s
\n" +"\n"
-" Daarna word je doorgestuurd naar een pagina waar je moet inloggen. Nadat "
-"je bent ingelogd, haal je het formulier op met de volgende code:\n"
-"
\n"
-"
\n"
-" %(tt_openvariable)s code %(tt_closevariable)s\n"
+"Via deze link kun je inloggen om het formulier te ondertekenen. Daarna nemen wij de aanvraag \n"
+"in behandeling.\n"
"
\n" +"%(tt_openvariable)s form_url %(tt_closevariable)s\n" +"
\n" +"\n" +"Met vriendelijke groet,
\n" +"\n" +"Open Formulieren
\n" #: openforms/emails/templates/emails/confirmation/content.html:7 #, python-format @@ -4825,12 +4855,9 @@ msgid "" "\n" "Dear Sir, Madam,This email address requires verification for the \"%(tt_openvariable)s " -"form_name %(tt_closevariable)s\" form.
\n" +"This email address requires verification for the \"%(tt_openvariable)s form_name %(tt_closevariable)s\" form.
\n" "\n" "Enter the code below to confirm your email address:
\n" "\n" "%(tt_openvariable)s code %(tt_closevariable)s
\n" "\n" -"If you did not request this verification, you can safely ignore this " -"email.
\n" +"If you did not request this verification, you can safely ignore this email.
\n" msgstr "" "\n" -"Dit e-mailadres moet gecontroleerd worden voor het \"%(tt_openvariable)s " -"form_name %(tt_closevariable)s\"-formulier.
\n" +"Dit e-mailadres moet gecontroleerd worden voor het \"%(tt_openvariable)s form_name %(tt_closevariable)s\"-formulier.
\n" "\n" "Voer de code die hieronder staat in om je e-mailadres te bevestigen:
\n" "\n" "%(tt_openvariable)s code %(tt_closevariable)s
\n" "\n" -"Als je niet zelf deze controle gestart bent, dan kan je deze e-mail " -"negeren.
\n" +"Als je niet zelf deze controle gestart bent, dan kan je deze e-mail negeren.
\n" #: openforms/emails/templates/emails/email_verification/subject.txt:1 #, python-format @@ -4982,15 +4996,11 @@ msgid "" "\n" "Dear Sir or Madam,This is a request to co-sign form "{{ tt_openvariable }} form_name {{ tt_closevariable }}".
+Dear reader,
-{{ instruction }}
++Someone submitted the form "{{ tt_openvariable }} form_name {{ tt_closevariable }}" +via the website on {{ tt_openvariable }} submission_date {{ tt_closevariable }}. This +submission is not complete yet without your signature. +
+ +
- You will then be redirected to authenticate yourself. After authentication, fill in
- the following code to retrieve the form submission:
-
-
- {{ tt_openvariable }} code {{ tt_closevariable }}
+With the link below you can log in and sign the form submission. Then, we will
+process the request.
+{{ tt_openvariable }} form_url {{ tt_closevariable }} +
+ +Kind regards,
+ +Open Forms
{% endblocktranslate %} diff --git a/src/openforms/forms/api/serializers/form.py b/src/openforms/forms/api/serializers/form.py index cbaa1b4bc8..71b6d69b45 100644 --- a/src/openforms/forms/api/serializers/form.py +++ b/src/openforms/forms/api/serializers/form.py @@ -300,6 +300,7 @@ class Meta: "required_fields_with_asterisk", "submission_allowed", "suspension_allowed", + "send_confirmation_email", "appointment_options", "resume_link_lifetime", "hide_non_applicable_steps", diff --git a/src/openforms/submissions/report.py b/src/openforms/submissions/report.py index 6d1fe18fb3..5eb30e722b 100644 --- a/src/openforms/submissions/report.py +++ b/src/openforms/submissions/report.py @@ -59,6 +59,12 @@ def co_signer(self) -> str: if not (co_sign_data := self.submission.co_sign_data): return "" + # XXX this is something present in cosign v2 but not v1, which happens after the + # PDF is generated. Generating the PDF again after it's cosigned otherwise + # crashes. + if "cosign_date" in co_sign_data: + return "" + representation = co_sign_data.get("representation") or "" identifier = co_sign_data["identifier"] co_sign_auth_attribute = co_sign_data["co_sign_auth_attribute"] diff --git a/src/openforms/submissions/tasks/emails.py b/src/openforms/submissions/tasks/emails.py index ff1f4b2ba5..0a7e7d2bf1 100644 --- a/src/openforms/submissions/tasks/emails.py +++ b/src/openforms/submissions/tasks/emails.py @@ -2,6 +2,7 @@ from django.conf import settings from django.db import DatabaseError, transaction +from django.template.defaultfilters import date as date_filter from django.utils import translation from django.utils.translation import gettext_lazy as _ @@ -114,6 +115,10 @@ def send_email_cosigner(submission_id: int) -> None: "code": submission.public_registration_reference, "form_name": submission.form.name, "form_url": form_url, + # use the ``|date`` filter so that the timestamp is first localized to the correct + # timezone, and then the date is formatted according to the django global setting. + # This makes date representations consistent across the system. + "submission_date": date_filter(submission.completed_on), }, ) diff --git a/src/openforms/submissions/tests/test_tasks_pdf.py b/src/openforms/submissions/tests/test_tasks_pdf.py index d641affe0f..7dc8ab0519 100644 --- a/src/openforms/submissions/tests/test_tasks_pdf.py +++ b/src/openforms/submissions/tests/test_tasks_pdf.py @@ -559,3 +559,19 @@ def test_incomplete_cosign_data_missing_representation(self): ), ) self.assertIn(identifier, rendered) + + def test_cosign_v2_data(self): + report = SubmissionReportFactory.create( + content="", + submission__completed=True, + submission__co_sign_data={ + "plugin": "digid", + "attribute": "bsn", + "value": "123456782", + "cosign_date": "2024-01-01T17:00:00Z", + }, + ) + + html: str = report.generate_submission_report_pdf() + + self.assertNotEqual(html, "")