You are here

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.

File

templates/commerce-recurring-payment-declined.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Template for the payment declined email sent during the dunning process.
  5. *
  6. * Available variables:
  7. * - order_entity: The order entity.
  8. * - retry_num: The number of times this payment has been tried in the past.
  9. * - retry_days: The number of days until the next retry.
  10. * - max_retries: The number of retries from the billing schedule.
  11. * - now: The current time (used for testing).
  12. * - payment_method_link: A link to the user's payment methods page.
  13. * - billing_information: The rendered billing information.
  14. * - shipping_information: The rendered shipping information.
  15. * - payment_method: The rendered payment method.
  16. * - totals: An array of order totals values with the following keys:
  17. * - subtotal: The order subtotal price.
  18. * - adjustments: An array of adjustment totals:
  19. * - type: The adjustment type.
  20. * - label: The adjustment label.
  21. * - total: The adjustment total price.
  22. * - weight: The adjustment weight, taken from the adjustment type.
  23. * - total: The order total price.
  24. *
  25. * @ingroup themeable
  26. */
  27. #}
  28. <table style="margin: 15px auto 0 auto; max-width: 768px; font-family: arial,sans-serif">
  29. <tbody>
  30. <tr>
  31. <td>
  32. <table style="margin-left: auto; margin-right: auto; max-width: 768px; text-align: center;">
  33. <tbody>
  34. <tr>
  35. <td>
  36. <a href="{{ url('<front>') }}" style="color: #0e69be; text-decoration: none; font-weight: bold; margin-top: 15px;">{{ order_entity.getStore.label }}</a>
  37. </td>
  38. </tr>
  39. </tbody>
  40. </table>
  41. <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;">
  42. <tbody>
  43. <tr>
  44. <td style="font-size: 30px; padding-bottom: 30px">{{ 'Payment declined.'|t }}</td>
  45. </tr>
  46. <tr>
  47. <td style="font-weight: bold; padding-top:15px; padding-bottom: 15px; text-align: left; border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc">
  48. {{ '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}) }}
  49. {% if remaining_retries >= 2 %}
  50. {{ 'Our next charge attempt will be on: @date.'|t({'@date': now|date_modify(retry_days)|date('F d')}) }}
  51. {% elseif remaining_retries == 1 %}
  52. {{ 'Our final charge attempt will be on: @date.'|t({'@date': now|date_modify(retry_days)|date('F d')}) }}
  53. {% else %}
  54. {{ '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}) }}
  55. {% endif %}
  56. </td>
  57. </tr>
  58. <tr>
  59. <td style="font-weight: bold; padding-top:15px; padding-bottom: 15px; text-align: left; border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc">
  60. {{ 'Order #@number details:'|t({'@number': order_entity.getOrderNumber}) }}
  61. </td>
  62. </tr>
  63. <tr>
  64. <td>
  65. {% block order_items %}
  66. <table style="padding-top: 15px; padding-bottom:15px; width: 100%">
  67. <tbody style="text-align: left;">
  68. {% for order_item in order_entity.getItems %}
  69. <tr>
  70. <td>
  71. {{ order_item.getQuantity|number_format }} x
  72. </td>
  73. <td>
  74. <span>{{ order_item.label }}</span>
  75. <span style="float: right;">{{ order_item.getTotalPrice|commerce_price_format }}</span>
  76. </td>
  77. </tr>
  78. {% endfor %}
  79. </tbody>
  80. </table>
  81. {% endblock %}
  82. </td>
  83. </tr>
  84. <tr>
  85. <td>
  86. {% if (billing_information or shipping_information) %}
  87. <table style="width: 100%; padding-top:15px; padding-bottom: 15px; text-align: left; border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc">
  88. <tbody>
  89. <tr>
  90. {% if shipping_information %}
  91. <td style="padding-top: 5px; font-weight: bold;">{{ 'Shipping Information'|t }}</td>
  92. {% endif %}
  93. {% if billing_information %}
  94. <td style="padding-top: 5px; font-weight: bold;">{{ 'Billing Information'|t }}</td>
  95. {% endif %}
  96. </tr>
  97. <tr>
  98. {% if shipping_information %}
  99. <td>
  100. {% block shipping_information %}
  101. {{ shipping_information }}
  102. {% endblock %}
  103. </td>
  104. {% endif %}
  105. {% if billing_information %}
  106. <td>
  107. {% block billing_information %}
  108. {{ billing_information }}
  109. {% endblock %}
  110. </td>
  111. {% endif %}
  112. </tr>
  113. {% if payment_method %}
  114. <tr>
  115. <td style="font-weight: bold; margin-top: 10px;">{{ 'Payment Method'|t }}</td>
  116. </tr>
  117. <tr>
  118. <td>
  119. {% block payment_method %}
  120. {{ payment_method }}
  121. {% endblock %}
  122. </td>
  123. </tr>
  124. {% endif %}
  125. </tbody>
  126. </table>
  127. {% endif %}
  128. </td>
  129. </tr>
  130. <tr>
  131. <td>
  132. <p style="margin-bottom: 0;">
  133. {{ 'Subtotal: @subtotal'|t({'@subtotal': totals.subtotal|commerce_price_format}) }}
  134. </p>
  135. </td>
  136. </tr>
  137. {% for adjustment in totals.adjustments %}
  138. <tr>
  139. <td>
  140. <p style="margin-bottom: 0;">
  141. {{ adjustment.label }}: {{ adjustment.total|commerce_price_format }}
  142. </p>
  143. </td>
  144. </tr>
  145. {% endfor %}
  146. <tr>
  147. <td>
  148. <p style="font-size: 24px; padding-top: 15px; padding-bottom: 5px;">
  149. {{ 'Order Total: @total'|t({'@total': order_entity.getTotalPrice|commerce_price_format}) }}
  150. </p>
  151. </td>
  152. </tr>
  153. <tr>
  154. <td>
  155. {% block additional_information %}
  156. {{ 'Thank you for your attention to this matter.'|t }}
  157. {% endblock %}
  158. </td>
  159. </tr>
  160. </tbody>
  161. </table>
  162. </td>
  163. </tr>
  164. </tbody>
  165. </table>