Separate the message to sponsor and org in digital contracts
authorMagnus Hagander <magnus@hagander.net>
Tue, 20 Feb 2024 20:09:30 +0000 (21:09 +0100)
committerMagnus Hagander <magnus@hagander.net>
Tue, 20 Feb 2024 20:09:30 +0000 (21:09 +0100)
With an extension of the upstream APIs we can now send separate mssages
to the different parties of the signing. With this we can keep the
"sponsor friendly" message we have now for the sponsors, and send a more
appropriate message to the organizers to make it clear what the next
step is.

In the internal API we make it an optional parameter, so if another
future provider doesn't support separating the messages, things still
work.

postgresqleu/confsponsor/views.py
postgresqleu/digisign/implementations/signwell.py

index 917280a767ae3af69b55ed7ca2d3befd01c8d603..b51d2785ee67ee3a0dc8df90ff78e2879323fba8 100644 (file)
@@ -376,6 +376,7 @@ def _generate_and_send_sponsor_contract(sponsor):
             level.contract.fieldjson,
             conference.contractexpires,
             test=False,
+            message_to_sender="The contract for {} sponsorship of {} has been signed by {}. It is now time for the organizers to countersign.".format(level.levelname, conference.conferencename, sponsor.name),
         )
         return contractid, error
 
@@ -1838,6 +1839,7 @@ def sponsor_admin_addcontract(request, confurlname, sponsorid):
             contract.fieldjson,
             conference.contractexpires,
             test=False,
+            message_to_sender="The contract for {} has been signed by sponsor {}. It is now time for the organizers to countersign.".format(subject, sponsor.name),
         )
         if error:
             messages.error(request, "Failed to send digital contract.")
index fd82a4b4caeffe6c3465af81e8a63aa2b8a183d3..e5d30f77f6e9e29bf192acaff74594c1536e61d0 100644 (file)
@@ -87,7 +87,7 @@ class Signwell(BaseProvider):
     def description_text(self, signeremail):
         return 'Signing instructions will be delivered to {}. If necessary, you will be able to re-route the signing from the provider interface to somebody else in your organisation once the process is started.'.format(signeremail)
 
-    def send_contract(self, sender_name, sender_email, recipient_name, recipient_email, pdf, pdfname, subject, message, metadata, fielddata, expires_in, test):
+    def send_contract(self, sender_name, sender_email, recipient_name, recipient_email, pdf, pdfname, subject, message, metadata, fielddata, expires_in, test, message_to_sender=None):
         if self.provider.config.get('forcetest', False):
             # Override test to be true if configured for enforcement.
             test = True
@@ -113,6 +113,7 @@ class Signwell(BaseProvider):
                     "id": "2",
                     "name": sender_name,
                     "email": sender_email,
+                    "message": message_to_sender or message,
                 },
             ],
             "apply_signing_order": True,