commerce-recurring-payment-declined.html.twig in Commerce Recurring Framework 8
Template for the payment declined email sent during the dunning process.
Available variables:
- order_entity: The order entity.
- retry_num: The number of times this payment has been tried in the past.
- retry_days: The number of days until the next retry.
- max_retries: The number of retries from the billing schedule.
- now: The current time (used for testing).
- payment_method_link: A link to the user's payment methods page.
- billing_information: The rendered billing information.
- shipping_information: The rendered shipping information.
- payment_method: The rendered payment method.
- totals: An array of order totals values with the following keys:
- subtotal: The order subtotal price.
- adjustments: An array of adjustment totals:
- type: The adjustment type.
- label: The adjustment label.
- total: The adjustment total price.
- weight: The adjustment weight, taken from the adjustment type.
- total: The order total price.
1 theme call to commerce-recurring-payment-declined.html.twig
- PaymentDeclinedMail::send in src/
Mail/ PaymentDeclinedMail.php - Sends a payment declined email.
File
templates/commerce-recurring-payment-declined.html.twigView source
- {#
- /**
- * @file
- * Template for the payment declined email sent during the dunning process.
- *
- * Available variables:
- * - order_entity: The order entity.
- * - retry_num: The number of times this payment has been tried in the past.
- * - retry_days: The number of days until the next retry.
- * - max_retries: The number of retries from the billing schedule.
- * - now: The current time (used for testing).
- * - payment_method_link: A link to the user's payment methods page.
- * - billing_information: The rendered billing information.
- * - shipping_information: The rendered shipping information.
- * - payment_method: The rendered payment method.
- * - totals: An array of order totals values with the following keys:
- * - subtotal: The order subtotal price.
- * - adjustments: An array of adjustment totals:
- * - type: The adjustment type.
- * - label: The adjustment label.
- * - total: The adjustment total price.
- * - weight: The adjustment weight, taken from the adjustment type.
- * - total: The order total price.
- *
- * @ingroup themeable
- */
- #}
- <table style="margin: 15px auto 0 auto; max-width: 768px; font-family: arial,sans-serif">
- <tbody>
- <tr>
- <td>
- <table style="margin-left: auto; margin-right: auto; max-width: 768px; text-align: center;">
- <tbody>
- <tr>
- <td>
- <a href="{{ url('<front>') }}" style="color: #0e69be; text-decoration: none; font-weight: bold; margin-top: 15px;">{{ order_entity.getStore.label }}</a>
- </td>
- </tr>
- </tbody>
- </table>
- <table style="text-align: center; min-width: 450px; margin: 5px auto 0 auto; border: 1px solid #cccccc; border-radius: 5px; padding: 40px 30px 30px 30px;">
- <tbody>
- <tr>
- <td style="font-size: 30px; padding-bottom: 30px">{{ 'Payment declined.'|t }}</td>
- </tr>
- <tr>
- <td style="font-weight: bold; padding-top:15px; padding-bottom: 15px; text-align: left; border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc">
- {{ 'We regret to inform you that the most recent charge attempt on your card failed. Please <a href="@href">update your payment method</a>.'|t({'@href': payment_method_link}) }}
-
- {% if remaining_retries >= 2 %}
- {{ 'Our next charge attempt will be on: @date.'|t({'@date': now|date_modify(retry_days)|date('F d')}) }}
-
- {% elseif remaining_retries == 1 %}
- {{ 'Our final charge attempt will be on: @date.'|t({'@date': now|date_modify(retry_days)|date('F d')}) }}
- {% else %}
- {{ 'This was our final charge attempt. Please <a href="@href">update your payment method</a> and then contact us to restore your service.'|t({'@href': payment_method_link}) }}
- {% endif %}
- </td>
- </tr>
- <tr>
- <td style="font-weight: bold; padding-top:15px; padding-bottom: 15px; text-align: left; border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc">
- {{ 'Order #@number details:'|t({'@number': order_entity.getOrderNumber}) }}
- </td>
- </tr>
- <tr>
- <td>
- {% block order_items %}
- <table style="padding-top: 15px; padding-bottom:15px; width: 100%">
- <tbody style="text-align: left;">
- {% for order_item in order_entity.getItems %}
- <tr>
- <td>
- {{ order_item.getQuantity|number_format }} x
- </td>
- <td>
- <span>{{ order_item.label }}</span>
- <span style="float: right;">{{ order_item.getTotalPrice|commerce_price_format }}</span>
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% endblock %}
- </td>
- </tr>
- <tr>
- <td>
- {% if (billing_information or shipping_information) %}
- <table style="width: 100%; padding-top:15px; padding-bottom: 15px; text-align: left; border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc">
- <tbody>
- <tr>
- {% if shipping_information %}
- <td style="padding-top: 5px; font-weight: bold;">{{ 'Shipping Information'|t }}</td>
- {% endif %}
- {% if billing_information %}
- <td style="padding-top: 5px; font-weight: bold;">{{ 'Billing Information'|t }}</td>
- {% endif %}
- </tr>
- <tr>
- {% if shipping_information %}
- <td>
- {% block shipping_information %}
- {{ shipping_information }}
- {% endblock %}
- </td>
- {% endif %}
- {% if billing_information %}
- <td>
- {% block billing_information %}
- {{ billing_information }}
- {% endblock %}
- </td>
- {% endif %}
- </tr>
- {% if payment_method %}
- <tr>
- <td style="font-weight: bold; margin-top: 10px;">{{ 'Payment Method'|t }}</td>
- </tr>
- <tr>
- <td>
- {% block payment_method %}
- {{ payment_method }}
- {% endblock %}
- </td>
- </tr>
- {% endif %}
- </tbody>
- </table>
- {% endif %}
- </td>
- </tr>
- <tr>
- <td>
- <p style="margin-bottom: 0;">
- {{ 'Subtotal: @subtotal'|t({'@subtotal': totals.subtotal|commerce_price_format}) }}
- </p>
- </td>
- </tr>
- {% for adjustment in totals.adjustments %}
- <tr>
- <td>
- <p style="margin-bottom: 0;">
- {{ adjustment.label }}: {{ adjustment.total|commerce_price_format }}
- </p>
- </td>
- </tr>
- {% endfor %}
- <tr>
- <td>
- <p style="font-size: 24px; padding-top: 15px; padding-bottom: 5px;">
- {{ 'Order Total: @total'|t({'@total': order_entity.getTotalPrice|commerce_price_format}) }}
- </p>
- </td>
- </tr>
- <tr>
- <td>
- {% block additional_information %}
- {{ 'Thank you for your attention to this matter.'|t }}
- {% endblock %}
- </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- </tbody>
- </table>