Difference between revisions of "Nats common mailer examples"
From TMM Wiki
Jump to navigationJump to search(8 intermediate revisions by 6 users not shown) | |||
Line 3: | Line 3: | ||
}} | }} | ||
− | This page is here to give you a list of common mailers that are done through NATS4. | + | This page is here to give you a list of common mailers that are done through [[NATS4]]. |
'''NOTE: Even when copying these examples you should ALWAYS run test e-mails to make sure your e-mail is sent out properly.''' | '''NOTE: Even when copying these examples you should ALWAYS run test e-mails to make sure your e-mail is sent out properly.''' | ||
__TOC__ | __TOC__ | ||
− | |||
==Latest FHG== | ==Latest FHG== | ||
===Template Functions Used=== | ===Template Functions Used=== | ||
Line 20: | Line 19: | ||
{list_sites} | {list_sites} | ||
{foreach from=$sites key=site_id item=site_name} | {foreach from=$sites key=site_id item=site_name} | ||
− | + | <b>5 Latest FHG for {$site_name}:</b><br /> | |
− | <b>5 Latest FHG for {$site_name}:</b> | + | {display_adtools data_only=1 order="published_date DESC" count=5 category=2 typeid=2 siteid=$site_id programid=1} |
− | + | {foreach from=$adtools key=adtool_id item=adtool_data} | |
− | + | {nats_encode siteid=$site_id programid=1 userid=$toid adtoolid=$adtool_data.adtoolid url=1} | |
− | + | <a href="{$encoded}">{$adtool_data.name}</a><br /> | |
− | + | <b>{$adtool_data.description}</b><br /> | |
− | + | {/foreach} | |
− | + | <br /><br /> | |
{/foreach} | {/foreach} | ||
</pre> | </pre> | ||
− | *"{list_sites}" - is creating an array with | + | * "'''{list_sites}'''" - is creating an array with [[Ct#Site|sites]] that are *not* hidden<br> |
− | *"{foreach from=$sites key=site_id item=site_name}" - will loop through every site defining a variable for both its id(key) and name(item)<br> | + | * "'''{foreach from=$sites key=site_id item=site_name}'''" - will loop through every [[Ct#Site|site]] defining a variable for both its id(key) and name(item)<br> |
− | *" | + | * "'''5 Latest FHG for {$site_name}'''": - will display the text "5 Latest FHG for " and then your current site name <br> |
− | + | * "'''{display_adtools data_only=1 order="published_date DESC" count=5 category=2 typeid=2 siteid=$site_id}'''" - doesnt actually display anything, what it does is grab paramaters such as order, count, category, typeid, and siteid. As you can see in this example, it will grab the latest 5 [[Ct#Adtool|adtools]] within category 2 (hosted galleries)and typeid 2 (free hosted galleries) for siteid of the current site the loop is on.<br> | |
− | *"{display_adtools data_only=1 order="published_date DESC" count=5 category=2 typeid=2 siteid=$site_id}" - doesnt actually display anything, what it does is grab paramaters such as order, count, category, typeid, and siteid. As you can see in this example, it will | + | * "'''{foreach from=$adtools key=adtool_id item=adtool_data}'''" - will loop through every [[Ct#Adtool|adtool]] defining a variable for both its id and data. <br> |
− | *"{foreach from=$adtools key=adtool_id item=adtool_data}" - will loop through every adtool defining a variable for both its id and data. <br> | + | * "'''{nats_encode siteid=$siteid programid=1 userid=$toid adtoolid=$adtool_id}'''" - will do the nats encode of the current [[Ct#Site|site]] in the loop with the paramaters of programid, userid, adtoolid which would be the current adtoolid of the loop <br> |
− | * "{nats_encode siteid=$siteid programid=1 userid=$toid adtoolid=$adtool_id}" - will do the nats encode of the current site in the loop with the paramaters of programid, userid, adtoolid which would be the current adtoolid of the loop <br> | + | * "'''<a href="{$encoded}">{$adtool_data.name}</a>'''" - will display the url and the name of the [[Ct#Adtool|adtool]]<br> |
− | *"<a href="{$encoded}">{$adtool_data.name}</a>" - will | + | * "'''{$adtool_data.description}'''" - will display the details given in the description for each [[Ct#Adtool|adtool]]. |
− | *"{$adtool_data.description}" - will display the details given in the description for each adtool. | + | |
+ | [[Category:NATS4 Mailers]] |
Latest revision as of 14:24, 14 May 2013
This page is here to give you a list of common mailers that are done through NATS4.
NOTE: Even when copying these examples you should ALWAYS run test e-mails to make sure your e-mail is sent out properly.
Latest FHG
Template Functions Used
Nats_encode
Nats_display_adtools
list_sites
list_programs
Code Example
{list_sites} {foreach from=$sites key=site_id item=site_name} <b>5 Latest FHG for {$site_name}:</b><br /> {display_adtools data_only=1 order="published_date DESC" count=5 category=2 typeid=2 siteid=$site_id programid=1} {foreach from=$adtools key=adtool_id item=adtool_data} {nats_encode siteid=$site_id programid=1 userid=$toid adtoolid=$adtool_data.adtoolid url=1} <a href="{$encoded}">{$adtool_data.name}</a><br /> <b>{$adtool_data.description}</b><br /> {/foreach} <br /><br /> {/foreach}
- "{list_sites}" - is creating an array with sites that are *not* hidden
- "{foreach from=$sites key=site_id item=site_name}" - will loop through every site defining a variable for both its id(key) and name(item)
- "5 Latest FHG for {$site_name}": - will display the text "5 Latest FHG for " and then your current site name
- "{display_adtools data_only=1 order="published_date DESC" count=5 category=2 typeid=2 siteid=$site_id}" - doesnt actually display anything, what it does is grab paramaters such as order, count, category, typeid, and siteid. As you can see in this example, it will grab the latest 5 adtools within category 2 (hosted galleries)and typeid 2 (free hosted galleries) for siteid of the current site the loop is on.
- "{foreach from=$adtools key=adtool_id item=adtool_data}" - will loop through every adtool defining a variable for both its id and data.
- "{nats_encode siteid=$siteid programid=1 userid=$toid adtoolid=$adtool_id}" - will do the nats encode of the current site in the loop with the paramaters of programid, userid, adtoolid which would be the current adtoolid of the loop
- "<a href="{$encoded}">{$adtool_data.name}</a>" - will display the url and the name of the adtool
- "{$adtool_data.description}" - will display the details given in the description for each adtool.