Ver código fonte

[#3826] Streamline handling of links in email templates

master
Martin Winkel 3 anos atrás
pai
commit
6eceb19a59

+ 3
- 0
src/oscar/apps/checkout/mixins.py Ver arquivo

290
             # We don't care that much if we can't resolve the URL
290
             # We don't care that much if we can't resolve the URL
291
             pass
291
             pass
292
         else:
292
         else:
293
+            ctx['status_path'] = path
294
+
295
+            # status_url is deprecated, see https://github.com/django-oscar/django-oscar/issues/3826
293
             site = Site.objects.get_current(self.request)
296
             site = Site.objects.get_current(self.request)
294
             ctx['status_url'] = 'http://%s%s' % (site.domain, path)
297
             ctx['status_url'] = 'http://%s%s' % (site.domain, path)
295
         return ctx
298
         return ctx

+ 3
- 2
src/oscar/templates/oscar/communication/emails/commtype_order_placed_body.html Ver arquivo

1
 {% extends "oscar/communication/emails/base.html" %}
1
 {% extends "oscar/communication/emails/base.html" %}
2
-{% load currency_filters i18n %}
2
+{% load currency_filters i18n url_tags %}
3
 
3
 
4
 {% block tbody %}
4
 {% block tbody %}
5
 <tr>
5
 <tr>
57
 {% if status_url %}
57
 {% if status_url %}
58
     <tr>
58
     <tr>
59
         <td class="content-block">
59
         <td class="content-block">
60
-            {% blocktrans %}You can view the status of this order by clicking <a href="{{ status_url }}" title="order status">here</a>{% endblocktrans %}
60
+            {% absolute_url site.domain status_path as absolute_status_url %}
61
+            {% blocktrans %}You can view the status of this order by clicking <a href="{{ absolute_status_url }}" title="order status">here</a>{% endblocktrans %}
61
         </td>
62
         </td>
62
     </tr>
63
     </tr>
63
 {% endif %}
64
 {% endif %}

+ 3
- 2
src/oscar/templates/oscar/communication/emails/commtype_order_placed_body.txt Ver arquivo

1
-{% load currency_filters i18n %}{% blocktrans with order_number=order.number %}Hello,
1
+{% load currency_filters i18n url_tags %}{% blocktrans with order_number=order.number %}Hello,
2
 
2
 
3
 We are pleased to confirm your order {{ order_number }} has been received and
3
 We are pleased to confirm your order {{ order_number }} has been received and
4
 will be processed shortly.{% endblocktrans %}
4
 will be processed shortly.{% endblocktrans %}
17
 {% endfor %}
17
 {% endfor %}
18
 
18
 
19
 {% if status_url %}
19
 {% if status_url %}
20
+{% absolute_url site.domain status_path as absolute_status_url %}
20
 {% blocktrans %}You can view the status of this order at the below URL:
21
 {% blocktrans %}You can view the status of this order at the below URL:
21
-{{ status_url }}{% endblocktrans %}
22
+{{ absolute_status_url }}{% endblocktrans %}
22
 {% endif %}
23
 {% endif %}
23
 
24
 
24
 {% blocktrans %}The team{% endblocktrans %}
25
 {% blocktrans %}The team{% endblocktrans %}

Carregando…
Cancelar
Salvar