digest_text

NAML documentation   Watch a video
   Usages of this macro
... in emails.naml
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<override_macro name="digest_text" requires="subscription,node_list" unindent="true">
  <n.set_local_subscription
Macro
Parameters: subscription
.this_subscription
Binary
Namespace: SubscriptionNamespace
Parameters: do
/>
  <t>Digest Email</t>
  "<n.local_subscription
Macro
Parameters: do
.node
Binary
Namespace: SubscriptionNamespace
Parameters: do
.subject
Macro
Requires: node
/>"
  <n.digest_post_count
Macro
Requires: node_list
/>
 
  <n.reset_list_index
Binary
Namespace: ListSequence
/>
  <n.loop
Macro
Requires: sequence
Parameters: by, do
.>
    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.local_subscription
Macro
Parameters: do
.user
Binary
Namespace: SubscriptionNamespace
Parameters: do
.can_view
Macro
Requires: user
Parameters: node_attr
.current_node
Binary
Namespace: NodeList
Parameters: do
>
      <then>
        [<n.current_node
Binary
Namespace: NodeList
Parameters: do
.digest_subject
Macro
Requires: node
/>]
        <n.compress
Macro
Parameters: text
.>
          <n.truncate
Binary
Namespace: NabbleNamespace
Parameters: size, if_truncated, text
. size="200">
            <n.current_node
Binary
Namespace: NodeList
Parameters: do
.message
Binary
Namespace: NodeNamespace
Parameters: do
.as_text
Binary
Namespace: MessageNamespace
/>
          </n.truncate.>
        </n.compress.>
        <n.compress
Macro
Parameters: text
.>
          <t>by <t.author.current_node
Binary
Namespace: NodeList
Parameters: do
.owner
Binary
Namespace: NodeNamespace
Parameters: do
.name
Binary
Namespace: UserNamespace
Parameters: truncate
/></t>
          <t>on <t.date.current_node
Binary
Namespace: NodeList
Parameters: do
.when_created
Binary
Namespace: NodeNamespace
Parameters: do
.custom_format
Binary
Namespace: DateNamespace
Parameters: format
 format="yyyy-MM-dd"/></t>
          <t>in <t.location.current_node
Binary
Namespace: NodeList
Parameters: do
.get_app_node
Binary
Namespace: NodeNamespace
Parameters: do
.subject
Macro
Requires: node
/></t>
        </n.compress.>
 
        <t>Read more</t>
        <n.current_node
Binary
Namespace: NodeList
Parameters: do
.url
Macro
Requires: node
Parameters: template, date, index_record
/>
 
 
        <n.nop
Binary
Namespace: BasicNamespace
/>
      </then>
    </n.if.local_subscription.user.can_view.current_node>
  </n.loop.>
  <n.unsubscribe_line
Macro
Requires: subscription
Parameters: format
 format="text"/>
 
  ---
  <t>DO NOT REPLY TO THIS EMAIL</t>
 
  <t>Replies sent to this message are not read or processed.</t>
  <t>If you want to respond to a post, please visit: <t.url.local_subscription
Macro
Parameters: do
.node
Binary
Namespace: SubscriptionNamespace
Parameters: do
.url
Macro
Requires: node
Parameters: template, date, index_record
/></t>
</override_macro>
Overrides default macro
... in email.naml
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<macro name="digest_text" requires="subscription,node_list" unindent="true">
    <n.set_local_subscription.this_subscription/>
    <t>Digest Email</t>
    "<n.local_subscription.node.subject/>"
    <n.digest_post_count/>
 
    <n.reset_list_index/>
    <n.loop.>
        [<n.current_node.digest_subject/>]
        <n.compress.>
            <n.truncate. size="200">
                <n.current_node.message.as_text/>
            </n.truncate.>
        </n.compress.>
        <n.compress.>
            <t>by <t.author.current_node.owner.name/></t>
            <t>on <t.date.current_node.when_created.custom_format format="yyyy-MM-dd"/></t>
            <t>in <t.location.current_node.get_app_node.subject/></t>
        </n.compress.>
 
        <t>Read more</t>
        <n.current_node.url/>
 
        <n.nop/>
    </n.loop.>
    <n.unsubscribe_line format="text"/>
 
    ---
    <t>DO NOT REPLY TO THIS EMAIL</t>
 
    <t>Replies sent to this address are not read or processed.</t>
    <t>If you want to respond to a post for which you received this email,
    please go to the website: <t.url.local_subscription.node.url/></t>
</macro>