Mercurial Hosting > nabble
comparison src/nabble/modules/naml/invite_subscribers.naml @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children | 72765b66e2c3 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:7ecd1a4ef557 |
---|---|
1 <override_macro name="add_subscribers" requires="node"> | |
2 <n.if.is_submitted_form> | |
3 <then.process_invited_emails/> | |
4 <else.invite_subscribers_form/> | |
5 </n.if.is_submitted_form> | |
6 </override_macro> | |
7 | |
8 <macro name="invite_subscribers_form"> | |
9 <div class="weak-color" style="margin:.5em 0 .5em"> | |
10 <t>Enter one email address or user name per row:</t> | |
11 </div> | |
12 <n.form.> | |
13 <input type="hidden" name="filter" value="invite"/> | |
14 <textarea name="invited-emails" style="width:40em;height:12em"></textarea> | |
15 | |
16 <div class="weak-color" style="font-size:80%;margin:1em 0 .5em"> | |
17 <t>Examples:</t> | |
18 <div style="margin-left:1em"> | |
19 john_smith<br/> | |
20 john_smith@example.com<br/> | |
21 John Smith <john_smith@example.com> | |
22 </div> | |
23 </div> | |
24 | |
25 <div class="weak-color" style="margin:1.5em 0 .5em"> | |
26 <t><b>IMPORTANT</b>: Nabble will send an invitation to each email in the list. | |
27 Users will have to click on a link to confirm their subscription.</t> | |
28 </div> | |
29 | |
30 <div style="margin-top:1.4em"> | |
31 <input type="submit" value="[t]Invite Subscribers[/t]" /> | |
32 </div> | |
33 </n.form.> | |
34 </macro> | |
35 | |
36 <macro name="invited_emails" requires="servlet"> | |
37 <n.get_parameter name="invited-emails"/> | |
38 </macro> | |
39 | |
40 <macro name="process_invited_emails"> | |
41 <div class="second-font field-title"> | |
42 <t>Subscription Results</t> | |
43 </div> | |
44 <n.if.not.is_null.invited_emails> | |
45 <then> | |
46 <n.string_list. values="[n.invited_emails/]" separator="\n"> | |
47 <table> | |
48 <n.loop.> | |
49 <n.set_var. name='email'> | |
50 <n.get_email_address_from.current_string/> | |
51 </n.set_var.> | |
52 | |
53 <n.if.not.is_empty.var name='email'> | |
54 <then> | |
55 <n.set_local_subscription.page_node.subscription_for email="[n.var name='email'/]" /> | |
56 <n.if.not.local_subscription.is_subscribed> | |
57 <then.if.local_subscription.user.can_view.local_subscription.node> | |
58 <then> | |
59 <n.local_subscription.send_subscription_invite/> | |
60 <n.row_success.current_string/> | |
61 </then> | |
62 <else.row_failed text="[n.current_string/]" explaination="[t]This user doesn't have permission to view this application (add him/her to a group that allows this and try again)[/t]"/> | |
63 </then.if.local_subscription.user.can_view.local_subscription.node> | |
64 <else.row_success text="[n.current_string/]" explaination="[t]Already subscribed[/t]"/> | |
65 </n.if.not.local_subscription.is_subscribed> | |
66 </then> | |
67 <else.row_failed.current_string/> | |
68 </n.if.not.is_empty.var> | |
69 </n.loop.> | |
70 </table> | |
71 </n.string_list.> | |
72 </then> | |
73 </n.if.not.is_null.invited_emails> | |
74 </macro> | |
75 | |
76 <macro name="row_success" dot_parameter="text" parameters="explaination"> | |
77 <tr> | |
78 <td style="padding:.3em"><n.text/></td> | |
79 <td> | |
80 <t>Success</t> | |
81 <n.if.not.is_empty.explaination> | |
82 <then> -- <n.explaination/></then> | |
83 </n.if.not.is_empty.explaination> | |
84 </td> | |
85 </tr> | |
86 </macro> | |
87 | |
88 <macro name="row_failed" dot_parameter="text" parameters="explaination"> | |
89 <tr> | |
90 <td style="padding:.3em"><n.text/></td> | |
91 <td class="important"> | |
92 <t>Failed</t> | |
93 <n.if.not.is_empty.explaination> | |
94 <then> -- <n.explaination/></then> | |
95 </n.if.not.is_empty.explaination> | |
96 </td> | |
97 </tr> | |
98 </macro> | |
99 | |
100 <macro name="send_subscription_invite" requires="subscription,node_page,servlet"> | |
101 <n.set_local_subscription.this_subscription /> | |
102 <n.new_email.> | |
103 <n.send> | |
104 <to><n.user.user_email/></to> | |
105 <subject><t>Subscribe to <t.location.page_node.subject/></t></subject> | |
106 <text_part> | |
107 <t>Dear user,</t> | |
108 | |
109 <t><t.owner_name.page_node.owner.name/> is inviting you to subscribe to <t.location.page_node.subject/>:</t> | |
110 <n.page_node.url/> | |
111 | |
112 <t>With your subscription, updates will be sent directly to your email address | |
113 and you can reply to them to participate in the discussion. Your subscription works the same | |
114 as a mailing list.</t> | |
115 | |
116 <t>To confirm your subscription, click on the link below:</t> | |
117 <n.local_subscription.send_subscription_invite_subscribe_by_code_url/> | |
118 | |
119 <t>Sincerely,</t> | |
120 <t>The Nabble team</t> | |
121 ________________________________________ | |
122 <t>Free Embeddable <t.app.page_node.view_name/></t> powered by Nabble | |
123 <n.nabble_homepage/> | |
124 </text_part> | |
125 <html_part> | |
126 <t>Dear user,</t><br/> | |
127 <br/> | |
128 <t><t.owner_name.page_node.owner.name/> is inviting you to subscribe to <t.location.bold.page_node.subject/>:</t><br/> | |
129 <a href="[n.page_node.url/]"><n.page_node.url/></a><br/> | |
130 <br/> | |
131 <t>With your subscription, updates will be sent directly to your email address | |
132 and you can reply to them to participate in the discussion. Your subscription works the same | |
133 as a mailing list.</t><br/> | |
134 <br/> | |
135 <t>To confirm your subscription, click on the link below:</t> | |
136 <div style="background-color:#FFFADB;border:#EDDD79 solid 1px;margin:1.2em 0;padding:.5em"> | |
137 <a href="[n.local_subscription.send_subscription_invite_subscribe_by_code_url/]"> | |
138 <n.local_subscription.send_subscription_invite_subscribe_by_code_url/> | |
139 </a> | |
140 </div> | |
141 <t>Sincerely,</t><br/> | |
142 <t>The Nabble team</t><br/> | |
143 ________________________________________<br/> | |
144 <t>Free Embeddable <t.app.page_node.view_name/></t> powered by Nabble<br/> | |
145 <n.nabble_homepage/><br/><br/> | |
146 </html_part> | |
147 </n.send> | |
148 </n.new_email.> | |
149 </macro> | |
150 | |
151 <macro name="send_subscription_invite_subscribe_by_code_url" requires="subscription"> | |
152 <n.subscribe_by_code_url subscription_to="DESCENDANTS"/> | |
153 </macro> |