class-Mandrill_Templates.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <meta name="generator" content="ApiGen 2.8.0" />
  6. <title>Class Mandrill_Templates</title>
  7. <script type="text/javascript" src="resources/combined.js?394153670"></script>
  8. <script type="text/javascript" src="elementlist.js?882160656"></script>
  9. <link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360" />
  10. </head>
  11. <body>
  12. <div id="left">
  13. <div id="menu">
  14. <a href="index.html" title="Overview"><span>Overview</span></a>
  15. <div id="groups">
  16. <h3>Namespaces</h3>
  17. <ul>
  18. <li class="active"><a href="namespace-None.html">None</a>
  19. </li>
  20. <li><a href="namespace-PHP.html">PHP</a>
  21. </li>
  22. </ul>
  23. </div>
  24. <hr />
  25. <div id="elements">
  26. <h3>Classes</h3>
  27. <ul>
  28. <li><a href="class-Mandrill.html">Mandrill</a></li>
  29. <li><a href="class-Mandrill_Exports.html">Mandrill_Exports</a></li>
  30. <li><a href="class-Mandrill_Inbound.html">Mandrill_Inbound</a></li>
  31. <li><a href="class-Mandrill_Internal.html">Mandrill_Internal</a></li>
  32. <li><a href="class-Mandrill_Ips.html">Mandrill_Ips</a></li>
  33. <li><a href="class-Mandrill_Messages.html">Mandrill_Messages</a></li>
  34. <li><a href="class-Mandrill_Metadata.html">Mandrill_Metadata</a></li>
  35. <li><a href="class-Mandrill_Rejects.html">Mandrill_Rejects</a></li>
  36. <li><a href="class-Mandrill_Senders.html">Mandrill_Senders</a></li>
  37. <li><a href="class-Mandrill_Subaccounts.html">Mandrill_Subaccounts</a></li>
  38. <li><a href="class-Mandrill_Tags.html">Mandrill_Tags</a></li>
  39. <li class="active"><a href="class-Mandrill_Templates.html">Mandrill_Templates</a></li>
  40. <li><a href="class-Mandrill_Urls.html">Mandrill_Urls</a></li>
  41. <li><a href="class-Mandrill_Users.html">Mandrill_Users</a></li>
  42. <li><a href="class-Mandrill_Webhooks.html">Mandrill_Webhooks</a></li>
  43. <li><a href="class-Mandrill_Whitelists.html">Mandrill_Whitelists</a></li>
  44. </ul>
  45. <h3>Exceptions</h3>
  46. <ul>
  47. <li><a href="class-Mandrill_Error.html">Mandrill_Error</a></li>
  48. <li><a href="class-Mandrill_HttpError.html">Mandrill_HttpError</a></li>
  49. <li><a href="class-Mandrill_Invalid_CustomDNS.html">Mandrill_Invalid_CustomDNS</a></li>
  50. <li><a href="class-Mandrill_Invalid_CustomDNSPending.html">Mandrill_Invalid_CustomDNSPending</a></li>
  51. <li><a href="class-Mandrill_Invalid_DeleteDefaultPool.html">Mandrill_Invalid_DeleteDefaultPool</a></li>
  52. <li><a href="class-Mandrill_Invalid_DeleteNonEmptyPool.html">Mandrill_Invalid_DeleteNonEmptyPool</a></li>
  53. <li><a href="class-Mandrill_Invalid_EmptyDefaultPool.html">Mandrill_Invalid_EmptyDefaultPool</a></li>
  54. <li><a href="class-Mandrill_Invalid_Key.html">Mandrill_Invalid_Key</a></li>
  55. <li><a href="class-Mandrill_Invalid_Reject.html">Mandrill_Invalid_Reject</a></li>
  56. <li><a href="class-Mandrill_Invalid_Tag_Name.html">Mandrill_Invalid_Tag_Name</a></li>
  57. <li><a href="class-Mandrill_Invalid_Template.html">Mandrill_Invalid_Template</a></li>
  58. <li><a href="class-Mandrill_IP_ProvisionLimit.html">Mandrill_IP_ProvisionLimit</a></li>
  59. <li><a href="class-Mandrill_Metadata_FieldLimit.html">Mandrill_Metadata_FieldLimit</a></li>
  60. <li><a href="class-Mandrill_NoSendingHistory.html">Mandrill_NoSendingHistory</a></li>
  61. <li><a href="class-Mandrill_PaymentRequired.html">Mandrill_PaymentRequired</a></li>
  62. <li><a href="class-Mandrill_PoorReputation.html">Mandrill_PoorReputation</a></li>
  63. <li><a href="class-Mandrill_ServiceUnavailable.html">Mandrill_ServiceUnavailable</a></li>
  64. <li><a href="class-Mandrill_Unknown_Export.html">Mandrill_Unknown_Export</a></li>
  65. <li><a href="class-Mandrill_Unknown_InboundDomain.html">Mandrill_Unknown_InboundDomain</a></li>
  66. <li><a href="class-Mandrill_Unknown_InboundRoute.html">Mandrill_Unknown_InboundRoute</a></li>
  67. <li><a href="class-Mandrill_Unknown_IP.html">Mandrill_Unknown_IP</a></li>
  68. <li><a href="class-Mandrill_Unknown_Message.html">Mandrill_Unknown_Message</a></li>
  69. <li><a href="class-Mandrill_Unknown_MetadataField.html">Mandrill_Unknown_MetadataField</a></li>
  70. <li><a href="class-Mandrill_Unknown_Pool.html">Mandrill_Unknown_Pool</a></li>
  71. <li><a href="class-Mandrill_Unknown_Sender.html">Mandrill_Unknown_Sender</a></li>
  72. <li><a href="class-Mandrill_Unknown_Subaccount.html">Mandrill_Unknown_Subaccount</a></li>
  73. <li><a href="class-Mandrill_Unknown_Template.html">Mandrill_Unknown_Template</a></li>
  74. <li><a href="class-Mandrill_Unknown_TrackingDomain.html">Mandrill_Unknown_TrackingDomain</a></li>
  75. <li><a href="class-Mandrill_Unknown_Url.html">Mandrill_Unknown_Url</a></li>
  76. <li><a href="class-Mandrill_Unknown_Webhook.html">Mandrill_Unknown_Webhook</a></li>
  77. <li><a href="class-Mandrill_ValidationError.html">Mandrill_ValidationError</a></li>
  78. </ul>
  79. </div>
  80. </div>
  81. </div>
  82. <div id="splitter"></div>
  83. <div id="right">
  84. <div id="rightInner">
  85. <form id="search">
  86. <input type="hidden" name="cx" value="" />
  87. <input type="hidden" name="ie" value="UTF-8" />
  88. <input type="text" name="q" class="text" />
  89. <input type="submit" value="Search" />
  90. </form>
  91. <div id="navigation">
  92. <ul>
  93. <li>
  94. <a href="index.html" title="Overview"><span>Overview</span></a>
  95. </li>
  96. <li>
  97. <a href="namespace-None.html" title="Summary of None"><span>Namespace</span></a>
  98. </li>
  99. <li class="active">
  100. <span>Class</span> </li>
  101. </ul>
  102. <ul>
  103. <li>
  104. <a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a>
  105. </li>
  106. </ul>
  107. <ul>
  108. </ul>
  109. </div>
  110. <div id="content" class="class">
  111. <h1>Class Mandrill_Templates</h1>
  112. <div class="info">
  113. <b>Located at</b> <a href="source-class-Mandrill_Templates.html#3-233" title="Go to source code">Mandrill/Templates.php</a><br />
  114. </div>
  115. <table class="summary" id="methods">
  116. <caption>Methods summary</caption>
  117. <tr data-order="__construct" id="___construct">
  118. <td class="attributes"><code>
  119. public
  120. </code>
  121. </td>
  122. <td class="name"><div>
  123. <a class="anchor" href="#___construct">#</a>
  124. <code><a href="source-class-Mandrill_Templates.html#4-6" title="Go to source code">__construct</a>( <span><code><a href="class-Mandrill.html">Mandrill</a></code> <var>$master</var></span> )</code>
  125. <div class="description short">
  126. </div>
  127. <div class="description detailed hidden">
  128. </div>
  129. </div></td>
  130. </tr>
  131. <tr data-order="add" id="_add">
  132. <td class="attributes"><code>
  133. public
  134. struct
  135. </code>
  136. </td>
  137. <td class="name"><div>
  138. <a class="anchor" href="#_add">#</a>
  139. <code><a href="source-class-Mandrill_Templates.html#8-42" title="Go to source code">add</a>( <span>string <var>$name</var></span>, <span>string <var>$from_email</var> = <span class="php-keyword1">null</span></span>, <span>string <var>$from_name</var> = <span class="php-keyword1">null</span></span>, <span>string <var>$subject</var> = <span class="php-keyword1">null</span></span>, <span>string <var>$code</var> = <span class="php-keyword1">null</span></span>, <span>string <var>$text</var> = <span class="php-keyword1">null</span></span>, <span>boolean <var>$publish</var> = <span class="php-keyword1">true</span></span>, <span>array <var>$labels</var> = <span class="php-keyword1">array</span>()</span> )</code>
  140. <div class="description short">
  141. <p>Add a new template</p>
  142. </div>
  143. <div class="description detailed hidden">
  144. <p>Add a new template</p>
  145. <h4>Parameters</h4>
  146. <div class="list"><dl>
  147. <dt><var>$name</var></dt>
  148. <dd><code>string</code><br>$name the name for the new template - must be unique</dd>
  149. <dt><var>$from_email</var></dt>
  150. <dd><code>string</code><br>$from_email a default sending address for emails sent using this template</dd>
  151. <dt><var>$from_name</var></dt>
  152. <dd><code>string</code><br>$from_name a default from name to be used</dd>
  153. <dt><var>$subject</var></dt>
  154. <dd><code>string</code><br>$subject a default subject line to be used</dd>
  155. <dt><var>$code</var></dt>
  156. <dd><code>string</code><br>$code the HTML code for the template with mc:edit attributes for the editable
  157. elements</dd>
  158. <dt><var>$text</var></dt>
  159. <dd><code>string</code><br>$text a default text part to be used when sending with this template</dd>
  160. <dt><var>$publish</var></dt>
  161. <dd><code>boolean</code><br>$publish set to false to add a draft template without publishing</dd>
  162. <dt><var>$labels</var></dt>
  163. <dd><code>array</code><br>$labels an optional array of up to 10 labels to use for filtering templates -
  164. labels[] string a single label</dd>
  165. </dl></div>
  166. <h4>Returns</h4>
  167. <div class="list">
  168. <code>struct</code><br>the information saved about the new template - slug string the immutable unique
  169. code name of the template - name string the name of the template - labels array
  170. the list of labels applied to the template - labels[] string a single label -
  171. code string the full HTML code of the template, with mc:edit attributes marking
  172. the editable elements - draft version - subject string the subject line of the
  173. template, if provided - draft version - from_email string the default sender
  174. address for the template, if provided - draft version - from_name string the
  175. default sender from name for the template, if provided - draft version - text
  176. string the default text part of messages sent with the template, if provided -
  177. draft version - publish_name string the same as the template name - kept as a
  178. separate field for backwards compatibility - publish_code string the full HTML
  179. code of the template, with mc:edit attributes marking the editable elements that
  180. are available as published, if it has been published - publish_subject string
  181. the subject line of the template, if provided - publish_from_email string the
  182. default sender address for the template, if provided - publish_from_name string
  183. the default sender from name for the template, if provided - publish_text string
  184. the default text part of messages sent with the template, if provided -
  185. published_at string the date and time the template was last published as a UTC
  186. string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published -
  187. created_at string the date and time the template was first created as a UTC
  188. string in YYYY-MM-DD HH:MM:SS format - updated_at string the date and time the
  189. template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format<br />
  190. </div>
  191. </div>
  192. </div></td>
  193. </tr>
  194. <tr data-order="info" id="_info">
  195. <td class="attributes"><code>
  196. public
  197. struct
  198. </code>
  199. </td>
  200. <td class="name"><div>
  201. <a class="anchor" href="#_info">#</a>
  202. <code><a href="source-class-Mandrill_Templates.html#44-70" title="Go to source code">info</a>( <span>string <var>$name</var></span> )</code>
  203. <div class="description short">
  204. <p>Get the information for an existing template</p>
  205. </div>
  206. <div class="description detailed hidden">
  207. <p>Get the information for an existing template</p>
  208. <h4>Parameters</h4>
  209. <div class="list"><dl>
  210. <dt><var>$name</var></dt>
  211. <dd><code>string</code><br>$name the immutable name of an existing template</dd>
  212. </dl></div>
  213. <h4>Returns</h4>
  214. <div class="list">
  215. <code>struct</code><br>the requested template information - slug string the immutable unique code name
  216. of the template - name string the name of the template - labels array the list
  217. of labels applied to the template - labels[] string a single label - code string
  218. the full HTML code of the template, with mc:edit attributes marking the editable
  219. elements - draft version - subject string the subject line of the template, if
  220. provided - draft version - from_email string the default sender address for the
  221. template, if provided - draft version - from_name string the default sender from
  222. name for the template, if provided - draft version - text string the default
  223. text part of messages sent with the template, if provided - draft version -
  224. publish_name string the same as the template name - kept as a separate field for
  225. backwards compatibility - publish_code string the full HTML code of the
  226. template, with mc:edit attributes marking the editable elements that are
  227. available as published, if it has been published - publish_subject string the
  228. subject line of the template, if provided - publish_from_email string the
  229. default sender address for the template, if provided - publish_from_name string
  230. the default sender from name for the template, if provided - publish_text string
  231. the default text part of messages sent with the template, if provided -
  232. published_at string the date and time the template was last published as a UTC
  233. string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published -
  234. created_at string the date and time the template was first created as a UTC
  235. string in YYYY-MM-DD HH:MM:SS format - updated_at string the date and time the
  236. template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format<br />
  237. </div>
  238. </div>
  239. </div></td>
  240. </tr>
  241. <tr data-order="update" id="_update">
  242. <td class="attributes"><code>
  243. public
  244. struct
  245. </code>
  246. </td>
  247. <td class="name"><div>
  248. <a class="anchor" href="#_update">#</a>
  249. <code><a href="source-class-Mandrill_Templates.html#72-106" title="Go to source code">update</a>( <span>string <var>$name</var></span>, <span>string <var>$from_email</var> = <span class="php-keyword1">null</span></span>, <span>string <var>$from_name</var> = <span class="php-keyword1">null</span></span>, <span>string <var>$subject</var> = <span class="php-keyword1">null</span></span>, <span>string <var>$code</var> = <span class="php-keyword1">null</span></span>, <span>string <var>$text</var> = <span class="php-keyword1">null</span></span>, <span>boolean <var>$publish</var> = <span class="php-keyword1">true</span></span>, <span>array <var>$labels</var> = <span class="php-keyword1">null</span></span> )</code>
  250. <div class="description short">
  251. <p>Update the code for an existing template. If null is provided for any fields,
  252. the values will remain unchanged.</p>
  253. </div>
  254. <div class="description detailed hidden">
  255. <p>Update the code for an existing template. If null is provided for any fields,
  256. the values will remain unchanged.</p>
  257. <h4>Parameters</h4>
  258. <div class="list"><dl>
  259. <dt><var>$name</var></dt>
  260. <dd><code>string</code><br>$name the immutable name of an existing template</dd>
  261. <dt><var>$from_email</var></dt>
  262. <dd><code>string</code><br>$from_email the new default sending address</dd>
  263. <dt><var>$from_name</var></dt>
  264. <dd><code>string</code><br>$from_name the new default from name</dd>
  265. <dt><var>$subject</var></dt>
  266. <dd><code>string</code><br>$subject the new default subject line</dd>
  267. <dt><var>$code</var></dt>
  268. <dd><code>string</code><br>$code the new code for the template</dd>
  269. <dt><var>$text</var></dt>
  270. <dd><code>string</code><br>$text the new default text part to be used</dd>
  271. <dt><var>$publish</var></dt>
  272. <dd><code>boolean</code><br>$publish set to false to update the draft version of the template without
  273. publishing</dd>
  274. <dt><var>$labels</var></dt>
  275. <dd><code>array</code><br>$labels an optional array of up to 10 labels to use for filtering templates -
  276. labels[] string a single label</dd>
  277. </dl></div>
  278. <h4>Returns</h4>
  279. <div class="list">
  280. <code>struct</code><br>the template that was updated - slug string the immutable unique code name of
  281. the template - name string the name of the template - labels array the list of
  282. labels applied to the template - labels[] string a single label - code string
  283. the full HTML code of the template, with mc:edit attributes marking the editable
  284. elements - draft version - subject string the subject line of the template, if
  285. provided - draft version - from_email string the default sender address for the
  286. template, if provided - draft version - from_name string the default sender from
  287. name for the template, if provided - draft version - text string the default
  288. text part of messages sent with the template, if provided - draft version -
  289. publish_name string the same as the template name - kept as a separate field for
  290. backwards compatibility - publish_code string the full HTML code of the
  291. template, with mc:edit attributes marking the editable elements that are
  292. available as published, if it has been published - publish_subject string the
  293. subject line of the template, if provided - publish_from_email string the
  294. default sender address for the template, if provided - publish_from_name string
  295. the default sender from name for the template, if provided - publish_text string
  296. the default text part of messages sent with the template, if provided -
  297. published_at string the date and time the template was last published as a UTC
  298. string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published -
  299. created_at string the date and time the template was first created as a UTC
  300. string in YYYY-MM-DD HH:MM:SS format - updated_at string the date and time the
  301. template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format<br />
  302. </div>
  303. </div>
  304. </div></td>
  305. </tr>
  306. <tr data-order="publish" id="_publish">
  307. <td class="attributes"><code>
  308. public
  309. struct
  310. </code>
  311. </td>
  312. <td class="name"><div>
  313. <a class="anchor" href="#_publish">#</a>
  314. <code><a href="source-class-Mandrill_Templates.html#108-134" title="Go to source code">publish</a>( <span>string <var>$name</var></span> )</code>
  315. <div class="description short">
  316. <p>Publish the content for the template. Any new messages sent using this
  317. template will start using the content that was previously in draft.</p>
  318. </div>
  319. <div class="description detailed hidden">
  320. <p>Publish the content for the template. Any new messages sent using this
  321. template will start using the content that was previously in draft.</p>
  322. <h4>Parameters</h4>
  323. <div class="list"><dl>
  324. <dt><var>$name</var></dt>
  325. <dd><code>string</code><br>$name the immutable name of an existing template</dd>
  326. </dl></div>
  327. <h4>Returns</h4>
  328. <div class="list">
  329. <code>struct</code><br>the template that was published - slug string the immutable unique code name of
  330. the template - name string the name of the template - labels array the list of
  331. labels applied to the template - labels[] string a single label - code string
  332. the full HTML code of the template, with mc:edit attributes marking the editable
  333. elements - draft version - subject string the subject line of the template, if
  334. provided - draft version - from_email string the default sender address for the
  335. template, if provided - draft version - from_name string the default sender from
  336. name for the template, if provided - draft version - text string the default
  337. text part of messages sent with the template, if provided - draft version -
  338. publish_name string the same as the template name - kept as a separate field for
  339. backwards compatibility - publish_code string the full HTML code of the
  340. template, with mc:edit attributes marking the editable elements that are
  341. available as published, if it has been published - publish_subject string the
  342. subject line of the template, if provided - publish_from_email string the
  343. default sender address for the template, if provided - publish_from_name string
  344. the default sender from name for the template, if provided - publish_text string
  345. the default text part of messages sent with the template, if provided -
  346. published_at string the date and time the template was last published as a UTC
  347. string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published -
  348. created_at string the date and time the template was first created as a UTC
  349. string in YYYY-MM-DD HH:MM:SS format - updated_at string the date and time the
  350. template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format<br />
  351. </div>
  352. </div>
  353. </div></td>
  354. </tr>
  355. <tr data-order="delete" id="_delete">
  356. <td class="attributes"><code>
  357. public
  358. struct
  359. </code>
  360. </td>
  361. <td class="name"><div>
  362. <a class="anchor" href="#_delete">#</a>
  363. <code><a href="source-class-Mandrill_Templates.html#136-162" title="Go to source code">delete</a>( <span>string <var>$name</var></span> )</code>
  364. <div class="description short">
  365. <p>Delete a template</p>
  366. </div>
  367. <div class="description detailed hidden">
  368. <p>Delete a template</p>
  369. <h4>Parameters</h4>
  370. <div class="list"><dl>
  371. <dt><var>$name</var></dt>
  372. <dd><code>string</code><br>$name the immutable name of an existing template</dd>
  373. </dl></div>
  374. <h4>Returns</h4>
  375. <div class="list">
  376. <code>struct</code><br>the template that was deleted - slug string the immutable unique code name of
  377. the template - name string the name of the template - labels array the list of
  378. labels applied to the template - labels[] string a single label - code string
  379. the full HTML code of the template, with mc:edit attributes marking the editable
  380. elements - draft version - subject string the subject line of the template, if
  381. provided - draft version - from_email string the default sender address for the
  382. template, if provided - draft version - from_name string the default sender from
  383. name for the template, if provided - draft version - text string the default
  384. text part of messages sent with the template, if provided - draft version -
  385. publish_name string the same as the template name - kept as a separate field for
  386. backwards compatibility - publish_code string the full HTML code of the
  387. template, with mc:edit attributes marking the editable elements that are
  388. available as published, if it has been published - publish_subject string the
  389. subject line of the template, if provided - publish_from_email string the
  390. default sender address for the template, if provided - publish_from_name string
  391. the default sender from name for the template, if provided - publish_text string
  392. the default text part of messages sent with the template, if provided -
  393. published_at string the date and time the template was last published as a UTC
  394. string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published -
  395. created_at string the date and time the template was first created as a UTC
  396. string in YYYY-MM-DD HH:MM:SS format - updated_at string the date and time the
  397. template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format<br />
  398. </div>
  399. </div>
  400. </div></td>
  401. </tr>
  402. <tr data-order="getList" id="_getList">
  403. <td class="attributes"><code>
  404. public
  405. array
  406. </code>
  407. </td>
  408. <td class="name"><div>
  409. <a class="anchor" href="#_getList">#</a>
  410. <code><a href="source-class-Mandrill_Templates.html#164-191" title="Go to source code">getList</a>( <span>string <var>$label</var> = <span class="php-keyword1">null</span></span> )</code>
  411. <div class="description short">
  412. <p>Return a list of all the templates available to this user</p>
  413. </div>
  414. <div class="description detailed hidden">
  415. <p>Return a list of all the templates available to this user</p>
  416. <h4>Parameters</h4>
  417. <div class="list"><dl>
  418. <dt><var>$label</var></dt>
  419. <dd><code>string</code><br>$label an optional label to filter the templates</dd>
  420. </dl></div>
  421. <h4>Returns</h4>
  422. <div class="list">
  423. <code>array</code><br>an array of structs with information about each template - return[] struct the
  424. information on each template in the account - slug string the immutable unique
  425. code name of the template - name string the name of the template - labels array
  426. the list of labels applied to the template - labels[] string a single label -
  427. code string the full HTML code of the template, with mc:edit attributes marking
  428. the editable elements - draft version - subject string the subject line of the
  429. template, if provided - draft version - from_email string the default sender
  430. address for the template, if provided - draft version - from_name string the
  431. default sender from name for the template, if provided - draft version - text
  432. string the default text part of messages sent with the template, if provided -
  433. draft version - publish_name string the same as the template name - kept as a
  434. separate field for backwards compatibility - publish_code string the full HTML
  435. code of the template, with mc:edit attributes marking the editable elements that
  436. are available as published, if it has been published - publish_subject string
  437. the subject line of the template, if provided - publish_from_email string the
  438. default sender address for the template, if provided - publish_from_name string
  439. the default sender from name for the template, if provided - publish_text string
  440. the default text part of messages sent with the template, if provided -
  441. published_at string the date and time the template was last published as a UTC
  442. string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published -
  443. created_at string the date and time the template was first created as a UTC
  444. string in YYYY-MM-DD HH:MM:SS format - updated_at string the date and time the
  445. template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format<br />
  446. </div>
  447. </div>
  448. </div></td>
  449. </tr>
  450. <tr data-order="timeSeries" id="_timeSeries">
  451. <td class="attributes"><code>
  452. public
  453. array
  454. </code>
  455. </td>
  456. <td class="name"><div>
  457. <a class="anchor" href="#_timeSeries">#</a>
  458. <code><a href="source-class-Mandrill_Templates.html#193-212" title="Go to source code">timeSeries</a>( <span>string <var>$name</var></span> )</code>
  459. <div class="description short">
  460. <p>Return the recent history (hourly stats for the last 30 days) for a
  461. template</p>
  462. </div>
  463. <div class="description detailed hidden">
  464. <p>Return the recent history (hourly stats for the last 30 days) for a
  465. template</p>
  466. <h4>Parameters</h4>
  467. <div class="list"><dl>
  468. <dt><var>$name</var></dt>
  469. <dd><code>string</code><br>$name the name of an existing template</dd>
  470. </dl></div>
  471. <h4>Returns</h4>
  472. <div class="list">
  473. <code>array</code><br>the array of history information - return[] struct the stats for a single hour -
  474. time string the hour as a UTC date string in YYYY-MM-DD HH:MM:SS format - sent
  475. integer the number of emails that were sent during the hour - hard_bounces
  476. integer the number of emails that hard bounced during the hour - soft_bounces
  477. integer the number of emails that soft bounced during the hour - rejects integer
  478. the number of emails that were rejected during the hour - complaints integer the
  479. number of spam complaints received during the hour - opens integer the number of
  480. emails opened during the hour - unique_opens integer the number of unique opens
  481. generated by messages sent during the hour - clicks integer the number of
  482. tracked URLs clicked during the hour - unique_clicks integer the number of
  483. unique clicks generated by messages sent during the hour<br />
  484. </div>
  485. </div>
  486. </div></td>
  487. </tr>
  488. <tr data-order="render" id="_render">
  489. <td class="attributes"><code>
  490. public
  491. struct
  492. </code>
  493. </td>
  494. <td class="name"><div>
  495. <a class="anchor" href="#_render">#</a>
  496. <code><a href="source-class-Mandrill_Templates.html#214-231" title="Go to source code">render</a>( <span>string <var>$template_name</var></span>, <span>array <var>$template_content</var></span>, <span>array <var>$merge_vars</var> = <span class="php-keyword1">null</span></span> )</code>
  497. <div class="description short">
  498. <p>Inject content and optionally merge fields into a template, returning the
  499. HTML that results</p>
  500. </div>
  501. <div class="description detailed hidden">
  502. <p>Inject content and optionally merge fields into a template, returning the
  503. HTML that results</p>
  504. <h4>Parameters</h4>
  505. <div class="list"><dl>
  506. <dt><var>$template_name</var></dt>
  507. <dd><code>string</code><br>$template_name the immutable name of a template that exists in the user's
  508. account</dd>
  509. <dt><var>$template_content</var></dt>
  510. <dd><code>array</code><br>$template_content an array of template content to render. Each item in the array
  511. should be a struct with two keys - name: the name of the content block to set
  512. the content for, and content: the actual content to put into the block -
  513. template_content[] struct the injection of a single piece of content into a
  514. single editable region - name string the name of the mc:edit editable region to
  515. inject into - content string the content to inject</dd>
  516. <dt><var>$merge_vars</var></dt>
  517. <dd><code>array</code><br>$merge_vars optional merge variables to use for injecting merge field content.
  518. If this is not provided, no merge fields will be replaced. - merge_vars[] struct
  519. a single merge variable - name string the merge variable's name. Merge variable
  520. names are case-insensitive and may not start with _ - content string the merge
  521. variable's content</dd>
  522. </dl></div>
  523. <h4>Returns</h4>
  524. <div class="list">
  525. <code>struct</code><br>the result of rendering the given template with the content and merge field
  526. values injected - html string the rendered HTML as a string<br />
  527. </div>
  528. </div>
  529. </div></td>
  530. </tr>
  531. </table>
  532. </div>
  533. <div id="footer">
  534. API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
  535. </div>
  536. </div>
  537. </div>
  538. </body>
  539. </html>