prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Missing variable in "fulfillment" email
  Two small issues in the "fulfillment" email:
  - logo is missing
  - in footer there is missing template variable
  
  I've just tested it and this is how the email looks like:
  
  ![image](https://user-images.githubusercontent.com/5421321/38736166-7bd21386-3f2b-11e8-99e0-65459f62602a.png)
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `saleor/order/emails.py`
  Content:
  ```
  1 from celery import shared_task
  2 from django.conf import settings
  3 from django.contrib.sites.models import Site
  4 from django.urls import reverse
  5 from templated_email import send_templated_mail
  6 
  7 from ..core.utils import build_absolute_uri
  8 from ..seo.schema.email import get_order_confirmation_markup
  9 from .models import Fulfillment, Order
  10 
  11 CONFIRM_ORDER_TEMPLATE = 'source/order/confirm_order'
  12 CONFIRM_FULFILLMENT_TEMPLATE = 'source/order/confirm_fulfillment'
  13 UPDATE_FULFILLMENT_TEMPLATE = 'source/order/update_fulfillment'
  14 CONFIRM_PAYMENT_TEMPLATE = 'source/order/payment/confirm_payment'
  15 CONFIRM_NOTE_TEMPLATE = 'source/order/note/confirm_note'
  16 
  17 
  18 def get_email_context(order_token):
  19     """Prepares context required for email template rendering."""
  20     site = Site.objects.get_current()
  21     order_url = build_absolute_uri(
  22         reverse('order:details', kwargs={'token': order_token}))
  23     ctx = {
  24         'protocol': 'https' if settings.ENABLE_SSL else 'http',
  25         'site_name': site.name,
  26         'domain': site.domain,
  27         'url': order_url}
  28     return ctx
  29 
  30 
  31 def collect_data_for_email(order_pk, template):
  32     """Collects data required for email sending.
  33 
  34     Args:
  35         order_pk (int): order primary key
  36         template (str): email template path
  37     """
  38     order = Order.objects.get(pk=order_pk)
  39     recipient_email = order.get_user_current_email()
  40     email_context = get_email_context(order.token)
  41 
  42     # Order confirmation template requires additional information
  43     if template == CONFIRM_ORDER_TEMPLATE:
  44         email_markup = get_order_confirmation_markup(order)
  45         email_context.update(
  46             {'order': order, 'schema_markup': email_markup})
  47 
  48     return {
  49         'recipient_list': [recipient_email], 'template_name': template,
  50         'context': email_context, 'from_email': settings.ORDER_FROM_EMAIL}
  51 
  52 
  53 def collect_data_for_fullfillment_email(order_pk, template, fulfillment_pk):
  54     fulfillment = Fulfillment.objects.get(pk=fulfillment_pk)
  55     email_data = collect_data_for_email(order_pk, template)
  56     email_data.update({'context': {'fulfillment': fulfillment}})
  57     return email_data
  58 
  59 
  60 @shared_task
  61 def send_order_confirmation(order_pk):
  62     """Sends order confirmation email."""
  63     email_data = collect_data_for_email(order_pk, CONFIRM_ORDER_TEMPLATE)
  64     send_templated_mail(**email_data)
  65 
  66 
  67 @shared_task
  68 def send_fulfillment_confirmation(order_pk, fulfillment_pk):
  69     email_data = collect_data_for_fullfillment_email(
  70         order_pk, CONFIRM_FULFILLMENT_TEMPLATE, fulfillment_pk)
  71     send_templated_mail(**email_data)
  72 
  73 
  74 @shared_task
  75 def send_fulfillment_update(order_pk, fulfillment_pk):
  76     email_data = collect_data_for_fullfillment_email(
  77         order_pk, UPDATE_FULFILLMENT_TEMPLATE, fulfillment_pk)
  78     send_templated_mail(**email_data)
  79 
  80 
  81 @shared_task
  82 def send_payment_confirmation(order_pk):
  83     """Sends payment confirmation email."""
  84     email_data = collect_data_for_email(order_pk, CONFIRM_PAYMENT_TEMPLATE)
  85     send_templated_mail(**email_data)
  86 
  87 
  88 @shared_task
  89 def send_note_confirmation(order_pk):
  90     """Notifies customer, when new note was added to an order."""
  91     email_data = collect_data_for_email(order_pk, CONFIRM_NOTE_TEMPLATE)
  92     send_templated_mail(**email_data)
  93
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/saleor/order/emails.py b/saleor/order/emails.py
  --- a/saleor/order/emails.py
  +++ b/saleor/order/emails.py
  @@ -53,7 +53,7 @@
   def collect_data_for_fullfillment_email(order_pk, template, fulfillment_pk):
       fulfillment = Fulfillment.objects.get(pk=fulfillment_pk)
       email_data = collect_data_for_email(order_pk, template)
  -    email_data.update({'context': {'fulfillment': fulfillment}})
  +    email_data['context'].update({'fulfillment': fulfillment})
       return email_data
  
verification_info: {"golden_diff": "diff --git a/saleor/order/emails.py b/saleor/order/emails.py\n--- a/saleor/order/emails.py\n+++ b/saleor/order/emails.py\n@@ -53,7 +53,7 @@\n def collect_data_for_fullfillment_email(order_pk, template, fulfillment_pk):\n     fulfillment = Fulfillment.objects.get(pk=fulfillment_pk)\n     email_data = collect_data_for_email(order_pk, template)\n-    email_data.update({'context': {'fulfillment': fulfillment}})\n+    email_data['context'].update({'fulfillment': fulfillment})\n     return email_data\n", "issue": "Missing variable in \"fulfillment\" email\nTwo small issues in the \"fulfillment\" email:\r\n- logo is missing\r\n- in footer there is missing template variable\r\n\r\nI've just tested it and this is how the email looks like:\r\n\r\n![image](https://user-images.githubusercontent.com/5421321/38736166-7bd21386-3f2b-11e8-99e0-65459f62602a.png)\r\n\n", "before_files": [{"content": "from celery import shared_task\nfrom django.conf import settings\nfrom django.contrib.sites.models import Site\nfrom django.urls import reverse\nfrom templated_email import send_templated_mail\n\nfrom ..core.utils import build_absolute_uri\nfrom ..seo.schema.email import get_order_confirmation_markup\nfrom .models import Fulfillment, Order\n\nCONFIRM_ORDER_TEMPLATE = 'source/order/confirm_order'\nCONFIRM_FULFILLMENT_TEMPLATE = 'source/order/confirm_fulfillment'\nUPDATE_FULFILLMENT_TEMPLATE = 'source/order/update_fulfillment'\nCONFIRM_PAYMENT_TEMPLATE = 'source/order/payment/confirm_payment'\nCONFIRM_NOTE_TEMPLATE = 'source/order/note/confirm_note'\n\n\ndef get_email_context(order_token):\n    \"\"\"Prepares context required for email template rendering.\"\"\"\n    site = Site.objects.get_current()\n    order_url = build_absolute_uri(\n        reverse('order:details', kwargs={'token': order_token}))\n    ctx = {\n        'protocol': 'https' if settings.ENABLE_SSL else 'http',\n        'site_name': site.name,\n        'domain': site.domain,\n        'url': order_url}\n    return ctx\n\n\ndef collect_data_for_email(order_pk, template):\n    \"\"\"Collects data required for email sending.\n\n    Args:\n        order_pk (int): order primary key\n        template (str): email template path\n    \"\"\"\n    order = Order.objects.get(pk=order_pk)\n    recipient_email = order.get_user_current_email()\n    email_context = get_email_context(order.token)\n\n    # Order confirmation template requires additional information\n    if template == CONFIRM_ORDER_TEMPLATE:\n        email_markup = get_order_confirmation_markup(order)\n        email_context.update(\n            {'order': order, 'schema_markup': email_markup})\n\n    return {\n        'recipient_list': [recipient_email], 'template_name': template,\n        'context': email_context, 'from_email': settings.ORDER_FROM_EMAIL}\n\n\ndef collect_data_for_fullfillment_email(order_pk, template, fulfillment_pk):\n    fulfillment = Fulfillment.objects.get(pk=fulfillment_pk)\n    email_data = collect_data_for_email(order_pk, template)\n    email_data.update({'context': {'fulfillment': fulfillment}})\n    return email_data\n\n\n@shared_task\ndef send_order_confirmation(order_pk):\n    \"\"\"Sends order confirmation email.\"\"\"\n    email_data = collect_data_for_email(order_pk, CONFIRM_ORDER_TEMPLATE)\n    send_templated_mail(**email_data)\n\n\n@shared_task\ndef send_fulfillment_confirmation(order_pk, fulfillment_pk):\n    email_data = collect_data_for_fullfillment_email(\n        order_pk, CONFIRM_FULFILLMENT_TEMPLATE, fulfillment_pk)\n    send_templated_mail(**email_data)\n\n\n@shared_task\ndef send_fulfillment_update(order_pk, fulfillment_pk):\n    email_data = collect_data_for_fullfillment_email(\n        order_pk, UPDATE_FULFILLMENT_TEMPLATE, fulfillment_pk)\n    send_templated_mail(**email_data)\n\n\n@shared_task\ndef send_payment_confirmation(order_pk):\n    \"\"\"Sends payment confirmation email.\"\"\"\n    email_data = collect_data_for_email(order_pk, CONFIRM_PAYMENT_TEMPLATE)\n    send_templated_mail(**email_data)\n\n\n@shared_task\ndef send_note_confirmation(order_pk):\n    \"\"\"Notifies customer, when new note was added to an order.\"\"\"\n    email_data = collect_data_for_email(order_pk, CONFIRM_NOTE_TEMPLATE)\n    send_templated_mail(**email_data)\n", "path": "saleor/order/emails.py"}], "after_files": [{"content": "from celery import shared_task\nfrom django.conf import settings\nfrom django.contrib.sites.models import Site\nfrom django.urls import reverse\nfrom templated_email import send_templated_mail\n\nfrom ..core.utils import build_absolute_uri\nfrom ..seo.schema.email import get_order_confirmation_markup\nfrom .models import Fulfillment, Order\n\nCONFIRM_ORDER_TEMPLATE = 'source/order/confirm_order'\nCONFIRM_FULFILLMENT_TEMPLATE = 'source/order/confirm_fulfillment'\nUPDATE_FULFILLMENT_TEMPLATE = 'source/order/update_fulfillment'\nCONFIRM_PAYMENT_TEMPLATE = 'source/order/payment/confirm_payment'\nCONFIRM_NOTE_TEMPLATE = 'source/order/note/confirm_note'\n\n\ndef get_email_context(order_token):\n    \"\"\"Prepares context required for email template rendering.\"\"\"\n    site = Site.objects.get_current()\n    order_url = build_absolute_uri(\n        reverse('order:details', kwargs={'token': order_token}))\n    ctx = {\n        'protocol': 'https' if settings.ENABLE_SSL else 'http',\n        'site_name': site.name,\n        'domain': site.domain,\n        'url': order_url}\n    return ctx\n\n\ndef collect_data_for_email(order_pk, template):\n    \"\"\"Collects data required for email sending.\n\n    Args:\n        order_pk (int): order primary key\n        template (str): email template path\n    \"\"\"\n    order = Order.objects.get(pk=order_pk)\n    recipient_email = order.get_user_current_email()\n    email_context = get_email_context(order.token)\n\n    # Order confirmation template requires additional information\n    if template == CONFIRM_ORDER_TEMPLATE:\n        email_markup = get_order_confirmation_markup(order)\n        email_context.update(\n            {'order': order, 'schema_markup': email_markup})\n\n    return {\n        'recipient_list': [recipient_email], 'template_name': template,\n        'context': email_context, 'from_email': settings.ORDER_FROM_EMAIL}\n\n\ndef collect_data_for_fullfillment_email(order_pk, template, fulfillment_pk):\n    fulfillment = Fulfillment.objects.get(pk=fulfillment_pk)\n    email_data = collect_data_for_email(order_pk, template)\n    email_data['context'].update({'fulfillment': fulfillment})\n    return email_data\n\n\n@shared_task\ndef send_order_confirmation(order_pk):\n    \"\"\"Sends order confirmation email.\"\"\"\n    email_data = collect_data_for_email(order_pk, CONFIRM_ORDER_TEMPLATE)\n    send_templated_mail(**email_data)\n\n\n@shared_task\ndef send_fulfillment_confirmation(order_pk, fulfillment_pk):\n    email_data = collect_data_for_fullfillment_email(\n        order_pk, CONFIRM_FULFILLMENT_TEMPLATE, fulfillment_pk)\n    send_templated_mail(**email_data)\n\n\n@shared_task\ndef send_fulfillment_update(order_pk, fulfillment_pk):\n    email_data = collect_data_for_fullfillment_email(\n        order_pk, UPDATE_FULFILLMENT_TEMPLATE, fulfillment_pk)\n    send_templated_mail(**email_data)\n\n\n@shared_task\ndef send_payment_confirmation(order_pk):\n    \"\"\"Sends payment confirmation email.\"\"\"\n    email_data = collect_data_for_email(order_pk, CONFIRM_PAYMENT_TEMPLATE)\n    send_templated_mail(**email_data)\n\n\n@shared_task\ndef send_note_confirmation(order_pk):\n    \"\"\"Notifies customer, when new note was added to an order.\"\"\"\n    email_data = collect_data_for_email(order_pk, CONFIRM_NOTE_TEMPLATE)\n    send_templated_mail(**email_data)\n", "path": "saleor/order/emails.py"}]}