We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Confirmation e-mails are not sent
For some reason the confirmation e-mails are no longer being send.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `website/members/signals.py`
Content:
```
1 import datetime
2 from django.conf import settings
3 from django.core.mail import EmailMultiAlternatives
4 from django.db.models.signals import pre_save
5 from django.dispatch import receiver
6 from django.template import loader
7 from django.utils import timezone
8 from simple_email_confirmation import unconfirmed_email_created
9 
10 from members.models import Member
11 
12 
13 @receiver(unconfirmed_email_created, dispatch_uid='send_email_confirmation')
14 def send_confirmation_email(sender, email, user=None, **kwargs):
15     if user is not None:
16         context = {
17             'email': email,
18             'domain': settings.BASE_URL,
19             'site_name': settings.WAGTAIL_SITE_NAME,
20             'token': user.get_confirmation_key(email),
21         }
22 
23         subject = loader.render_to_string(
24             'members/email_change_subject.txt', context)
25         # Email subject *must not* contain newlines
26         subject = ''.join(subject.splitlines())
27         body = loader.render_to_string('members/email_change_email.html',
28                                        context)
29 
30         email_message = EmailMultiAlternatives(subject, body, None, [email])
31         email_message.send()
32 
33 
34 @receiver(pre_save, sender=Member, dispatch_uid='member_check_membership')
35 def check_membership(sender, instance, **kwargs):
36     if timezone.now() - instance.status_changed > datetime.timedelta(1):
37         instance.update_status()
38
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/website/members/signals.py b/website/members/signals.py
--- a/website/members/signals.py
+++ b/website/members/signals.py
@@ -12,6 +12,7 @@
 
 @receiver(unconfirmed_email_created, dispatch_uid='send_email_confirmation')
 def send_confirmation_email(sender, email, user=None, **kwargs):
+    user = user or sender
     if user is not None:
         context = {
             'email': email,

{"golden_diff": "diff --git a/website/members/signals.py b/website/members/signals.py\n--- a/website/members/signals.py\n+++ b/website/members/signals.py\n@@ -12,6 +12,7 @@\n \n @receiver(unconfirmed_email_created, dispatch_uid='send_email_confirmation')\n def send_confirmation_email(sender, email, user=None, **kwargs):\n+    user = user or sender\n     if user is not None:\n         context = {\n             'email': email,\n", "issue": "Confirmation e-mails are not sent\nFor some reason the confirmation e-mails are no longer being send.\n", "before_files": [{"content": "import datetime\nfrom django.conf import settings\nfrom django.core.mail import EmailMultiAlternatives\nfrom django.db.models.signals import pre_save\nfrom django.dispatch import receiver\nfrom django.template import loader\nfrom django.utils import timezone\nfrom simple_email_confirmation import unconfirmed_email_created\n\nfrom members.models import Member\n\n\n@receiver(unconfirmed_email_created, dispatch_uid='send_email_confirmation')\ndef send_confirmation_email(sender, email, user=None, **kwargs):\n    if user is not None:\n        context = {\n            'email': email,\n            'domain': settings.BASE_URL,\n            'site_name': settings.WAGTAIL_SITE_NAME,\n            'token': user.get_confirmation_key(email),\n        }\n\n        subject = loader.render_to_string(\n            'members/email_change_subject.txt', context)\n        # Email subject *must not* contain newlines\n        subject = ''.join(subject.splitlines())\n        body = loader.render_to_string('members/email_change_email.html',\n                                       context)\n\n        email_message = EmailMultiAlternatives(subject, body, None, [email])\n        email_message.send()\n\n\n@receiver(pre_save, sender=Member, dispatch_uid='member_check_membership')\ndef check_membership(sender, instance, **kwargs):\n    if timezone.now() - instance.status_changed > datetime.timedelta(1):\n        instance.update_status()\n", "path": "website/members/signals.py"}], "after_files": [{"content": "import datetime\nfrom django.conf import settings\nfrom django.core.mail import EmailMultiAlternatives\nfrom django.db.models.signals import pre_save\nfrom django.dispatch import receiver\nfrom django.template import loader\nfrom django.utils import timezone\nfrom simple_email_confirmation import unconfirmed_email_created\n\nfrom members.models import Member\n\n\n@receiver(unconfirmed_email_created, dispatch_uid='send_email_confirmation')\ndef send_confirmation_email(sender, email, user=None, **kwargs):\n    user = user or sender\n    if user is not None:\n        context = {\n            'email': email,\n            'domain': settings.BASE_URL,\n            'site_name': settings.WAGTAIL_SITE_NAME,\n            'token': user.get_confirmation_key(email),\n        }\n\n        subject = loader.render_to_string(\n            'members/email_change_subject.txt', context)\n        # Email subject *must not* contain newlines\n        subject = ''.join(subject.splitlines())\n        body = loader.render_to_string('members/email_change_email.html',\n                                       context)\n\n        email_message = EmailMultiAlternatives(subject, body, None, [email])\n        email_message.send()\n\n\n@receiver(pre_save, sender=Member, dispatch_uid='member_check_membership')\ndef check_membership(sender, instance, **kwargs):\n    if timezone.now() - instance.status_changed > datetime.timedelta(1):\n        instance.update_status()\n", "path": "website/members/signals.py"}]}