Mercurial Hosting > nabble
comparison src/nabble/view/naml/unsubscribe.naml @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:7ecd1a4ef557 |
---|---|
1 <macro name="unsubscribe" requires="servlet"> | |
2 <n.node_page.> | |
3 <n.if.is_submitted_form> | |
4 <then> | |
5 <n.if.equal value1="remove-subscription" value2="[n.action_parameter/]"> | |
6 <then> | |
7 <n.if.page_node.visitor_is_subscribed> | |
8 <then.page_node.visitor_subscription.remove/> | |
9 </n.if.page_node.visitor_is_subscribed> | |
10 <n.redirect_to.subscription_removed_url/> | |
11 </then> | |
12 </n.if.equal> | |
13 </then> | |
14 </n.if.is_submitted_form> | |
15 <n.html> | |
16 <head> | |
17 <meta name="robots" content="noindex,nofollow"/> | |
18 <n.title.><t>Unsubscribe</t></n.title.> | |
19 <n.main_title_css/> | |
20 </head> | |
21 <body> | |
22 <n.visitor.profile_header/> | |
23 | |
24 <div class="shaded-bg-color rounded second-font main-title"> | |
25 <t>Remove Subscription</t> | |
26 </div> | |
27 <div style="font-weight:bold;margin: 2em 0 1em"> | |
28 <t>Do you really want to unsubscribe from <t.location><a href="[n.page_node.url/]"><n.page_node.subject/></a></t.location>?</t> | |
29 </div> | |
30 | |
31 <n.unsubscription_form/> | |
32 </body> | |
33 </n.html> | |
34 </n.node_page.> | |
35 </macro> | |
36 | |
37 <macro name="unsubscription_form" requires="node_page"> | |
38 <n.form.> | |
39 <input type="hidden" name="node" value="[n.page_node.id/]"/> | |
40 <input type="hidden" name="action" value="remove-subscription"/> | |
41 <input type="submit" class="toolbar action-button" value="[t]Yes, unsubscribe now[/t]"/> | |
42 <t>or</t> <a href="[n.page_node.url/]"><t>Cancel</t></a> | |
43 </n.form.> | |
44 </macro> | |
45 | |
46 <macro name="subscription_removed" requires="servlet"> | |
47 <n.node_page.> | |
48 <n.subscription_msg | |
49 header="[t]Subscription Removed[/t]" | |
50 message="[t]Your subscription to [t.location.page_node.subject/] has been successfully removed.[/t]" | |
51 /> | |
52 </n.node_page.> | |
53 </macro> | |
54 | |
55 <macro name="subscription_removed_url"> | |
56 <n.remove_spaces.> | |
57 <n.page_node.base_url/> | |
58 /template/NamlServlet.jtp?macro=subscription_removed&node=<n.page_node.id/> | |
59 </n.remove_spaces.> | |
60 </macro> | |
61 | |
62 <macro name="unsubscribe_by_code_url" requires="subscription"> | |
63 <n.remove_spaces.> | |
64 <n.base_url/> | |
65 <n.encode_url.> | |
66 /template/NamlServlet.jtp?macro=unsubscribe_by_code&node=<n.node.id/>&code=<n.subscription_code/> | |
67 </n.encode_url.> | |
68 </n.remove_spaces.> | |
69 </macro> | |
70 | |
71 <!-- | |
72 Unsubscribe by code has a confirmation step to prevent crawlers from unsubscribing users without intention. | |
73 --> | |
74 <macro name="unsubscribe_by_code" requires="servlet"> | |
75 <n.node_page.> | |
76 <n.catch_exception. id="remove-subscription"> | |
77 <n.page_node.get_subscription_by_code. code="[n.code_parameter/]"> | |
78 <n.if.not.is_subscribed> | |
79 <then.throw_template_exception name="not_subscribed"/> | |
80 </n.if.not.is_subscribed> | |
81 <n.if.is_submitted_form> | |
82 <then> | |
83 <n.remove/> | |
84 <n.send_unsubscription_reminder/> | |
85 </then> | |
86 </n.if.is_submitted_form> | |
87 </n.page_node.get_subscription_by_code.> | |
88 </n.catch_exception.> | |
89 <n.html> | |
90 <head> | |
91 <meta name="robots" content="noindex,nofollow"/> | |
92 <n.title.><t>Remove Subscription</t></n.title.> | |
93 </head> | |
94 <body> | |
95 <n.edit_header first_text="[n.page_node.subject/]" second_text="[t]Remove Subscription[/t]" /> | |
96 | |
97 <n.if.has_exception for="remove-subscription"> | |
98 <then.handle_unsubscription_by_code_errors/> | |
99 <else> | |
100 <n.if.is_submitted_form> | |
101 <then> | |
102 <h2><t>Subscription Removed</t></h2> | |
103 <t>Your subscription to <t.location.page_node.subject/> has been successfully removed.</t> | |
104 </then> | |
105 <else> | |
106 <h2><t>Do you really want to unsubscribe from <t.location><a href="[n.page_node.url/]"><n.page_node.subject/></a></t.location>?</t></h2> | |
107 <n.form.> | |
108 <input type="hidden" name="code" value="[n.code_parameter/]"/> | |
109 <input type="hidden" name="action" value="remove-subscription"/> | |
110 <input type="submit" class="toolbar action-button" value="[t]Yes, unsubscribe now[/t]"/> | |
111 <t>or</t> <a href="[n.page_node.url/]"><t>Cancel</t></a> | |
112 </n.form.> | |
113 </else> | |
114 </n.if.is_submitted_form> | |
115 </else> | |
116 </n.if.has_exception> | |
117 </body> | |
118 </n.html> | |
119 </n.node_page.> | |
120 </macro> | |
121 | |
122 <macro name="handle_unsubscription_by_code_errors"> | |
123 <n.handle_exception. for="remove-subscription"> | |
124 <n.exception. name="invalid_link"> | |
125 <h2><t>Invalid Code</t></h2> | |
126 <t>The code in the URL is not valid.</t> | |
127 <t>Please contact Nabble Support if you need help.</t> | |
128 </n.exception.> | |
129 <n.exception. name="not_subscribed"> | |
130 <h2><t>You're not a subscriber</t></h2> | |
131 <t>You are not subscribed to <t.location.page_node.subject/>.</t> | |
132 </n.exception.> | |
133 </n.handle_exception.> | |
134 </macro> | |
135 | |
136 <macro name="send_unsubscription_reminder" requires="subscription,node_page,servlet"> | |
137 <n.set_local_subscription.this_subscription /> | |
138 <n.new_email.> | |
139 <n.send> | |
140 <to><n.user.user_email/></to> | |
141 <subject><t>You have been unsubscribed from <t.location.page_node.subject/></t></subject> | |
142 <text_part> | |
143 <t>Dear user,</t> | |
144 | |
145 <t>Your subscription to <t.location.page_node.subject/> has been removed. | |
146 If this was a mistake, you can re-subscribe by following the link below:</t> | |
147 <n.local_subscription.subscribe_by_code_url subscription_to="[n.to/]"/> | |
148 | |
149 <t>Sincerely,</t> | |
150 <t>The Nabble team</t> | |
151 ________________________________________ | |
152 <t>Free Embeddable <t.app.page_node.view_name/></t> powered by Nabble | |
153 <n.nabble_homepage/> | |
154 </text_part> | |
155 <html_part> | |
156 <t>Dear user,</t><br/> | |
157 <br/> | |
158 <t>Your subscription to <t.location.page_node.subject/> has been removed. | |
159 If this was a mistake, you can re-subscribe by following the link below:</t><br/> | |
160 <n.local_subscription.subscribe_by_code_url subscription_to="[n.to/]"/><br/> | |
161 <br/> | |
162 <t>Sincerely,</t><br/> | |
163 <t>The Nabble team</t><br/> | |
164 ________________________________________<br/> | |
165 <t>Free Embeddable <t.app.page_node.view_name/></t> powered by Nabble<br/> | |
166 <n.nabble_homepage/><br/><br/> | |
167 </html_part> | |
168 </n.send> | |
169 </n.new_email.> | |
170 </macro> |