Here are some examples of Tiki syntax that can be used to leverage this new functionality:
- 1. Emails attached to a tracker item via a relation field:
Tiki syntax Copy to clipboard !!! Emails attached to $$widget1 [item784]$$ via the relation field
{LIST()}
{filter type="file"}
{filter field="email_date" content="NOT "}
{filter field="relations" multivalue="tiki.file.attach.invert:trackeritem:784"}
{LIST}
- 2. Unread emails attached to a tracker item:
Tiki syntax Copy to clipboard !!! Unread emails attached to $$widget1 [item784]$$ via the relation field
{LIST()}
{filter type="file"}
{filter field="email_date" content="NOT "}
{filter field="email_flags" multivalue="NOT Seen"}
{filter field="relations" multivalue="tiki.file.attach.invert:trackeritem:784"}
{LIST}
- 3. Emails from the last 30 days from a specific IMAP folder in Cypht:
Tiki syntax Copy to clipboard !!! Emails from the last 30 days from a specific IMAP folder in Cypht {LIST()}
{filter cypht="example@example.org>INBOX, example@example.org>Sent"}
{filter range="email_date" to="now" gap="30 days"}
{sort mode="email_date_desc"}
{OUTPUT(template=table)}
{column label="Subject" field="subject" mode="raw"}
{column label="From" field="from" mode="raw"}
{column label="Date" field="date"}
{OUTPUT}
{LIST}
- 4. Emails in the past 1200 days attached to item784 via relations field:
Tiki syntax Copy to clipboard !!! Emails in the past 1200 days attached to [item784] via relations field
{LIST()}
{filter type="file"}
{filter range="email_date" to="now" gap="1200 days"}
{filter field="relations" multivalue="tiki.file.attach.invert:trackeritem:784"}
{sort mode="email_date_desc"}
{OUTPUT(template=table)}
{column label="Subject" field="subject" mode="raw"}
{column label="From" field="from" mode="raw"}
{column label="Date" field="date"}
{OUTPUT}
{FORMAT(name="subject")}{display name="email_subject" format="objectlink"}{FORMAT}
{FORMAT(name="from")}{display name="email_from"}{FORMAT}
{FORMAT(name="date")}{display name="email_date" format="datetime"}{FORMAT}
{LIST}
- 5. Emails attached to tracker 4 via sublist:
Tiki syntax Copy to clipboard !!! Emails attached to tracker 4 via sublist
{LIST()}
{filter type="trackeritem"}
{filter field="tracker_id" exact="4"}
{SUBLIST(name="files" multiple="1" required="1")}
{filter field="object_type" exact="file"}
{filter field="email_date" content="NOT "}
{filter field="relations" multivalue="tiki.file.attach.invert:trackeritem:$parent.object_id|multivalue$"}
{SUBLIST}
{OUTPUT(tplwiki="Email Report tpl")}
{OUTPUT}
{LIST}
- 6. Emails attached to items for category A via sublist:
Tiki syntax Copy to clipboard !!! Emails attached to items for category A via sublist
{LIST()}
{filter type="trackeritem"}
{filter categories="30"}
{SUBLIST(name="files" multiple="1" required="1")}
{filter field="object_type" exact="file"}
{filter field="email_date" content="NOT "}
{filter field="relations" multivalue="tiki.file.attach.invert:trackeritem:$parent.object_id|multivalue$"}
{SUBLIST}
{OUTPUT(tplwiki="Email Report tpl")}
{OUTPUT}
{LIST}
For example, your custom template in the "Email Report tpl" page could look like this:
Using a Wiki page as smarty template Copy to clipboard {if $emails|@count > 0}
Email Report
{foreach from=$emails item=email}
{$email.subject}
From: {$email.from}
Date: {$email.date|date_format:"%Y-%m-%d %H:%M:%S"}
Body: {$email.body}
{/foreach}
{else}
No emails found.
{/if}
- 7. Emails from the last 30 days from a specific IMAP folder(s) in Cypht:
Tiki syntax Copy to clipboard !!! Emails from the last 30 days from a specific IMAP folder(s) in Cypht
{LIST()}
{filter cypht="example@example.org>INBOX, example@example.org>Sent"}
{filter range="email_date" to="now" gap="30 days"}
{filter field="email_flags" multivalue="Seen"}
{sort mode="email_date_desc"}
{OUTPUT(template=table)}
{column label="Subject" field="subject" mode="raw"}
{column label="From" field="from" mode="raw"}
{column label="Date" field="date"}
{OUTPUT}
{FORMAT(name="subject")}{display name="email_subject" format="objectlink"}{FORMAT}
{FORMAT(name="from")}{display name="email_from"}{FORMAT}
{FORMAT(name="date")}{display name="email_date" format="datetime"}{FORMAT}
{LIST}
- 8. Emails from the last 30 days from a special folder in Cypht:
Tiki syntax Copy to clipboard !!! Emails from the last 30 days from a special folder in Cypht
{LIST()}
{filter cypht="Everything"}
{filter range="email_date" to="now" gap="30 days"}
{sort mode="email_date_desc"}
{OUTPUT(template=table)}
{column label="Subject" field="subject" mode="raw"}
{column label="From" field="from" mode="raw"}
{column label="Date" field="date"}
{OUTPUT}
{FORMAT(name="subject")}{display name="email_subject" format="objectlink"}{FORMAT}
{FORMAT(name="from")}{display name="email_from"}{FORMAT}
{FORMAT(name="date")}{display name="email_date" format="datetime"}{FORMAT}
{LIST}
A special thanks to Victor Emanouilov for the code examples provided.
With the addition of the report functionality for available emails, Tiki users can now manage their emails more efficiently and organized. This not only enhances the user experience but also facilitates the integration of emails into existing workflows.
|