{% extends 'base.html' %} {% load humanize %} {% block title %}SMS Detail{% endblock %} {% block content %}

📱 SMS Detail

← Back to SMS Logs
{% if log.status == 'sent' %}✓ Delivered{% elif log.status == 'failed' %}✗ Failed{% else %}⚠ Partial{% endif %} — {{ log.get_sms_type_display }}
Sent at
{{ log.created_at|date:"d/m/Y H:i:s" }}
Type
{{ log.get_sms_type_display }}
Sender ID
{{ log.sender_id }}
Recipients
{% for phone in log.recipients.split %} {{ phone|cut:"," }} {% endfor %} ({{ log.recipient_count }} total)
{% if log.loan_number %}
Loan
{{ log.loan_number }}
{% endif %} {% if log.borrower_name %}
Borrower
{{ log.borrower_name }}
{% endif %} {% if log.amount %}
Amount
KES {{ log.amount|floatformat:2|intcomma }}
{% endif %} {% if log.error_message %}
Error
{{ log.error_message }}
{% endif %}
📝 Message Text
{{ log.message }}
{{ log.message|length }} characters
🔌 Africa's Talking Response
{% if log.at_response %}
{% if log.at_response.SMSMessageData %} {% for r in log.at_response.SMSMessageData.Recipients %} {% endfor %} {% else %} {% endif %}
Message{{ log.at_response.SMSMessageData.Message }}
{{ r.number }} {% if r.status == 'Success' %} ✓ {{ r.status }} {% else %} ✗ {{ r.status }} {% endif %} {{ r.cost }}
{{ log.at_response }}
{% else %}

No API response recorded.

{% endif %}
{% if log.status != 'sent' %}
Re-send this SMS

This will send the exact same message to the same recipients again.

{% csrf_token %}
{% endif %}
{% endblock %}