mailing_templates_portal_unsubscribe.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <template id="unsubscribe">
  4. <div class="container o_unsubscribe_form">
  5. <div class="row">
  6. <form action="/mail/mailing/unsubscribe" method="POST" id="unsubscribe_form" class="col-lg-6 offset-lg-3 mt-4">
  7. <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
  8. <input type="hidden" name="email" t-att-value="email"/>
  9. <input type="hidden" name="mailing_id" t-att-value="mailing_id"/>
  10. <input type="hidden" name="res_id" t-att-value="res_id"/>
  11. <input type="hidden" name="unsubscribed_list" t-att-value="unsubscribed_list"/>
  12. <div>
  13. <t t-if="contacts">
  14. <div id="info_state" class="alert alert-success" role="status">
  15. <div id="subscription_info"></div>
  16. <div id="div_feedback">
  17. <p>We would appreciate if you provide feedback about why you updated<br/>your subscriptions</p>
  18. <textarea class="form-control" name="opt_out_feedback" cols="60" rows="3"></textarea>
  19. <br/>
  20. <div class="btn btn-primary text-start" id="button_feedback">Send</div>
  21. </div>
  22. </div>
  23. <h1 class="o_page_header">Mailing Subscriptions</h1>
  24. <p>Choose your mailing subscriptions</p>
  25. <div id="div_opt_out">
  26. <ul class="list-group">
  27. <t t-foreach="list_ids" t-as="list_id">
  28. <t t-if="list_id.is_public == True">
  29. <li class="list-group-item">
  30. <input type="checkbox" name="contact_ids"
  31. t-att-value="list_id['id']" t-att-checked="None if list_id['id'] in opt_out_list_ids else 'checked'"/>
  32. <t t-esc="list_id.name"/>
  33. <span t-if="list_id['id'] in opt_out_list_ids"
  34. class="o_mailing_portal_list_unsubscribed">
  35. Unsubscribed
  36. </span>
  37. </li>
  38. </t>
  39. </t>
  40. </ul>
  41. <div class="mb64 pt-3">
  42. <div class="btn btn-link float-end pe-0 text-uppercase"
  43. t-if="show_blacklist_button"
  44. id="button_add_blacklist"
  45. style="display:none">Blacklist Me</div>
  46. <div class="btn btn-link float-end pe-0 text-uppercase"
  47. id="button_remove_blacklist"
  48. style="display:none">Come Back</div>
  49. <button type="submit" id="send_form"
  50. class="btn btn-primary">Update my subscriptions</button>
  51. </div>
  52. </div>
  53. </t>
  54. <t t-else="">
  55. <div class="alert alert-info text-center" role="status">
  56. <p>You are not subscribed to any of our mailing list.</p>
  57. </div>
  58. </t>
  59. </div>
  60. </form>
  61. </div>
  62. </div>
  63. </template>
  64. <template id="unsubscribed">
  65. <div class="container o_unsubscribe_form">
  66. <div class="row">
  67. <input type="hidden" name="email" t-att-value="email"/>
  68. <input type="hidden" name="mailing_id" t-att-value="mailing_id"/>
  69. <input type="hidden" name="res_id" t-att-value="res_id"/>
  70. <div id="div_blacklist" class="col-lg-6 offset-lg-3">
  71. <h1 class="o_page_header">Mailing Subscriptions</h1>
  72. <div id="subscription_info" class="alert alert-success text-center" role="status">
  73. <p>You have been successfully <strong>unsubscribed</strong>!</p>
  74. </div>
  75. <div t-if="list_ids" class="alert alert-warning">
  76. <p class="text-center">You were still subscribed to those newsletters. You will not receive any news from them anymore:</p>
  77. <ul class="list-group mb-4">
  78. <t t-foreach="list_ids" t-as="list_id">
  79. <t t-if="list_id.is_public == True">
  80. <li class="list-group-item bg-transparent">
  81. <strong><t t-esc="list_id.name"/></strong>
  82. </li>
  83. </t>
  84. </t>
  85. </ul>
  86. </div>
  87. <div t-if="show_blacklist_button" class="mb64">
  88. <div class="btn btn-link float-end"
  89. id="button_add_blacklist"
  90. style="display:none">Blacklist Me</div>
  91. <div class="btn btn-link float-end"
  92. id="button_remove_blacklist"
  93. style="display:none">Come Back</div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </template>
  99. <template id="page_unsubscribe" name="Unsubscribe">
  100. <t t-call="mass_mailing.layout">
  101. <t t-call="mass_mailing.unsubscribe"/>
  102. </t>
  103. </template>
  104. <template id="page_unsubscribed" name="Unsubscribed">
  105. <t t-call="mass_mailing.layout">
  106. <t t-call="mass_mailing.unsubscribed"/>
  107. </t>
  108. </template>
  109. </odoo>