admin_user_status_field.html
1 year ago
confirm_unsubscribe.html
2 months ago
index.php
3 years ago
manage_subscription.html
2 months ago
unsubscribe_reason.html
2 months ago
unsubscribe_reason.html
44 lines
| 1 | <% block content %> |
| 2 | <form class="mailpoet-unsubscribe-reason" action="<%= actionUrl|escape %>" method="post"> |
| 3 | <input type="hidden" name="_wpnonce" value="<%= nonce|escape('html_attr') %>"> |
| 4 | <fieldset> |
| 5 | <legend><%= __('Please let us know why you unsubscribed:', 'mailpoet') %></legend> |
| 6 | <% for reason, label in reasons %> |
| 7 | <p> |
| 8 | <label> |
| 9 | <input type="radio" name="reason" value="<%= reason|escape('html_attr') %>" required> |
| 10 | <%= label|escape %> |
| 11 | </label> |
| 12 | </p> |
| 13 | <% if allowOtherText and reason == otherReason %> |
| 14 | <p class="mailpoet-unsubscribe-reason-text" hidden> |
| 15 | <label> |
| 16 | <%= __('Tell us more', 'mailpoet') %><br> |
| 17 | <textarea name="reason_text" maxlength="500" rows="4"></textarea> |
| 18 | </label> |
| 19 | </p> |
| 20 | <% endif %> |
| 21 | <% endfor %> |
| 22 | </fieldset> |
| 23 | <p> |
| 24 | <button type="submit"><%= __('Submit', 'mailpoet') %></button> |
| 25 | </p> |
| 26 | <% if allowOtherText %> |
| 27 | <script> |
| 28 | (function() { |
| 29 | var form = document.currentScript.closest('form'); |
| 30 | if (!form) return; |
| 31 | var textField = form.querySelector('.mailpoet-unsubscribe-reason-text'); |
| 32 | if (!textField) return; |
| 33 | var update = function() { |
| 34 | var selected = form.querySelector('input[name="reason"]:checked'); |
| 35 | textField.hidden = !selected || selected.value !== '<%= otherReason|escape('js') %>'; |
| 36 | }; |
| 37 | form.addEventListener('change', update); |
| 38 | update(); |
| 39 | }()); |
| 40 | </script> |
| 41 | <% endif %> |
| 42 | </form> |
| 43 | <% endblock %> |
| 44 |