Mercurial Hosting > nabble
annotate src/nabble/modules/naml/invite_subscribers.naml @ 48:8c39a2f1dc0c
mobile fix
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Sun, 20 Jun 2021 19:23:21 -0600 |
| parents | 72765b66e2c3 |
| children |
| rev | line source |
|---|---|
| 0 | 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 | |
|
47
72765b66e2c3
remove mailing list code
Franklin Schmidt <fschmidt@gmail.com>
parents:
0
diff
changeset
|
112 <t>With your subscription, updates will be sent directly to your email address.</t> |
| 0 | 113 |
| 114 <t>To confirm your subscription, click on the link below:</t> | |
| 115 <n.local_subscription.send_subscription_invite_subscribe_by_code_url/> | |
| 116 | |
| 117 <t>Sincerely,</t> | |
| 118 <t>The Nabble team</t> | |
| 119 ________________________________________ | |
| 120 <t>Free Embeddable <t.app.page_node.view_name/></t> powered by Nabble | |
| 121 <n.nabble_homepage/> | |
| 122 </text_part> | |
| 123 <html_part> | |
| 124 <t>Dear user,</t><br/> | |
| 125 <br/> | |
| 126 <t><t.owner_name.page_node.owner.name/> is inviting you to subscribe to <t.location.bold.page_node.subject/>:</t><br/> | |
| 127 <a href="[n.page_node.url/]"><n.page_node.url/></a><br/> | |
| 128 <br/> | |
|
47
72765b66e2c3
remove mailing list code
Franklin Schmidt <fschmidt@gmail.com>
parents:
0
diff
changeset
|
129 <t>With your subscription, updates will be sent directly to your email address.</t><br/> |
| 0 | 130 <br/> |
| 131 <t>To confirm your subscription, click on the link below:</t> | |
| 132 <div style="background-color:#FFFADB;border:#EDDD79 solid 1px;margin:1.2em 0;padding:.5em"> | |
| 133 <a href="[n.local_subscription.send_subscription_invite_subscribe_by_code_url/]"> | |
| 134 <n.local_subscription.send_subscription_invite_subscribe_by_code_url/> | |
| 135 </a> | |
| 136 </div> | |
| 137 <t>Sincerely,</t><br/> | |
| 138 <t>The Nabble team</t><br/> | |
| 139 ________________________________________<br/> | |
| 140 <t>Free Embeddable <t.app.page_node.view_name/></t> powered by Nabble<br/> | |
| 141 <n.nabble_homepage/><br/><br/> | |
| 142 </html_part> | |
| 143 </n.send> | |
| 144 </n.new_email.> | |
| 145 </macro> | |
| 146 | |
| 147 <macro name="send_subscription_invite_subscribe_by_code_url" requires="subscription"> | |
| 148 <n.subscribe_by_code_url subscription_to="DESCENDANTS"/> | |
| 149 </macro> |
