class-Mandrill_Messages.html 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038
  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_Messages</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 class="active"><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><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_Messages</h1>
  112. <div class="info">
  113. <b>Located at</b> <a href="source-class-Mandrill_Messages.html#3-406" title="Go to source code">Mandrill/Messages.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_Messages.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="send" id="_send">
  132. <td class="attributes"><code>
  133. public
  134. array
  135. </code>
  136. </td>
  137. <td class="name"><div>
  138. <a class="anchor" href="#_send">#</a>
  139. <code><a href="source-class-Mandrill_Messages.html#8-80" title="Go to source code">send</a>( <span>struct <var>$message</var></span>, <span>boolean <var>$async</var> = <span class="php-keyword1">false</span></span>, <span>string <var>$ip_pool</var> = <span class="php-keyword1">null</span></span>, <span>string <var>$send_at</var> = <span class="php-keyword1">null</span></span> )</code>
  140. <div class="description short">
  141. <p>Send a new transactional message through Mandrill</p>
  142. </div>
  143. <div class="description detailed hidden">
  144. <p>Send a new transactional message through Mandrill</p>
  145. <h4>Parameters</h4>
  146. <div class="list"><dl>
  147. <dt><var>$message</var></dt>
  148. <dd><code>struct</code><br>$message the information on the message to send - html string the full HTML
  149. content to be sent - text string optional full text content to be sent - subject
  150. string the message subject - from_email string the sender email address. -
  151. from_name string optional from name to be used - to array an array of recipient
  152. information. - to[] struct a single recipient's information. - email string the
  153. email address of the recipient - name string the optional display name to use
  154. for the recipient - type string the header type to use for the recipient,
  155. defaults to "to" if not provided - headers struct optional extra headers to add
  156. to the message (most headers are allowed) - important boolean whether or not
  157. this message is important, and should be delivered ahead of non-important
  158. messages - track_opens boolean whether or not to turn on open tracking for the
  159. message - track_clicks boolean whether or not to turn on click tracking for the
  160. message - auto_text boolean whether or not to automatically generate a text part
  161. for messages that are not given text - auto_html boolean whether or not to
  162. automatically generate an HTML part for messages that are not given HTML -
  163. inline_css boolean whether or not to automatically inline all CSS styles
  164. provided in the message HTML - only for HTML documents less than 256KB in size -
  165. url_strip_qs boolean whether or not to strip the query string from URLs when
  166. aggregating tracked URL data - preserve_recipients boolean whether or not to
  167. expose all recipients in to "To" header for each email - view_content_link
  168. boolean set to false to remove content logging for sensitive emails -
  169. bcc_address string an optional address to receive an exact copy of each
  170. recipient's email - tracking_domain string a custom domain to use for tracking
  171. opens and clicks instead of mandrillapp.com - signing_domain string a custom
  172. domain to use for SPF/DKIM signing instead of mandrill (for "via" or "on behalf
  173. of" in email clients) - return_path_domain string a custom domain to use for the
  174. messages's return-path - merge boolean whether to evaluate merge tags in the
  175. message. Will automatically be set to true if either merge_vars or
  176. global_merge_vars are provided. - global_merge_vars array global merge variables
  177. to use for all recipients. You can override these per recipient. -
  178. global_merge_vars[] struct a single global merge variable - name string the
  179. global merge variable's name. Merge variable names are case-insensitive and may
  180. not start with _ - content string the global merge variable's content -
  181. merge_vars array per-recipient merge variables, which override global merge
  182. variables with the same name. - merge_vars[] struct per-recipient merge
  183. variables - rcpt string the email address of the recipient that the merge
  184. variables should apply to - vars array the recipient's merge variables - vars[]
  185. struct a single merge variable - name string the merge variable's name. Merge
  186. variable names are case-insensitive and may not start with _ - content string
  187. the merge variable's content - tags array an array of string to tag the message
  188. with. Stats are accumulated using tags, though we only store the first 100 we
  189. see, so this should not be unique or change frequently. Tags should be 50
  190. characters or less. Any tags starting with an underscore are reserved for
  191. internal use and will cause errors. - tags[] string a single tag - must not
  192. start with an underscore - subaccount string the unique id of a subaccount for
  193. this message - must already exist or will fail with an error -
  194. google_analytics_domains array an array of strings indicating for which any
  195. matching URLs will automatically have Google Analytics parameters appended to
  196. their query string automatically. - google_analytics_campaign array|string
  197. optional string indicating the value to set for the utm_campaign tracking
  198. parameter. If this isn't provided the email's from address will be used instead.
  199. - metadata array metadata an associative array of user metadata. Mandrill will
  200. store this metadata and make it available for retrieval. In addition, you can
  201. select up to 10 metadata fields to index and make searchable using the Mandrill
  202. search api. - recipient_metadata array Per-recipient metadata that will override
  203. the global values specified in the metadata parameter. - recipient_metadata[]
  204. struct metadata for a single recipient - rcpt string the email address of the
  205. recipient that the metadata is associated with - values array an associated
  206. array containing the recipient's unique metadata. If a key exists in both the
  207. per-recipient metadata and the global metadata, the per-recipient metadata will
  208. be used. - attachments array an array of supported attachments to add to the
  209. message - attachments[] struct a single supported attachment - type string the
  210. MIME type of the attachment - name string the file name of the attachment -
  211. content string the content of the attachment as a base64-encoded string - images
  212. array an array of embedded images to add to the message - images[] struct a
  213. single embedded image - type string the MIME type of the image - must start with
  214. "image/" - name string the Content ID of the image - use &lt;img
  215. src="cid:THIS_VALUE"&gt; to reference the image in your HTML content - content
  216. string the content of the image as a base64-encoded string</dd>
  217. <dt><var>$async</var></dt>
  218. <dd><code>boolean</code><br>$async enable a background sending mode that is optimized for bulk sending. In
  219. async mode, messages/send will immediately return a status of "queued" for every
  220. recipient. To handle rejections when sending in async mode, set up a webhook for
  221. the 'reject' event. Defaults to false for messages with no more than 10
  222. recipients; messages with more than 10 recipients are always sent
  223. asynchronously, regardless of the value of async.</dd>
  224. <dt><var>$ip_pool</var></dt>
  225. <dd><code>string</code><br>$ip_pool the name of the dedicated ip pool that should be used to send the
  226. message. If you do not have any dedicated IPs, this parameter has no effect. If
  227. you specify a pool that does not exist, your default pool will be used instead.</dd>
  228. <dt><var>$send_at</var></dt>
  229. <dd><code>string</code><br>$send_at when this message should be sent as a UTC timestamp in YYYY-MM-DD
  230. HH:MM:SS format. If you specify a time in the past, the message will be sent
  231. immediately. An additional fee applies for scheduled email, and this feature is
  232. only available to accounts with a positive balance.</dd>
  233. </dl></div>
  234. <h4>Returns</h4>
  235. <div class="list">
  236. <code>array</code><br>of structs for each recipient containing the key "email" with the email address
  237. and "status" as either "sent", "queued", or "rejected" - return[] struct the
  238. sending results for a single recipient - email string the email address of the
  239. recipient - status string the sending status of the recipient - either "sent",
  240. "queued", "scheduled", "rejected", or "invalid" - reject_reason string the
  241. reason for the rejection if the recipient status is "rejected" - _id string the
  242. message's unique id<br />
  243. </div>
  244. </div>
  245. </div></td>
  246. </tr>
  247. <tr data-order="sendTemplate" id="_sendTemplate">
  248. <td class="attributes"><code>
  249. public
  250. array
  251. </code>
  252. </td>
  253. <td class="name"><div>
  254. <a class="anchor" href="#_sendTemplate">#</a>
  255. <code><a href="source-class-Mandrill_Messages.html#82-159" title="Go to source code">sendTemplate</a>( <span>string <var>$template_name</var></span>, <span>array <var>$template_content</var></span>, <span>struct <var>$message</var></span>, <span>boolean <var>$async</var> = <span class="php-keyword1">false</span></span>, <span>string <var>$ip_pool</var> = <span class="php-keyword1">null</span></span>, <span>string <var>$send_at</var> = <span class="php-keyword1">null</span></span> )</code>
  256. <div class="description short">
  257. <p>Send a new transactional message through Mandrill using a template</p>
  258. </div>
  259. <div class="description detailed hidden">
  260. <p>Send a new transactional message through Mandrill using a template</p>
  261. <h4>Parameters</h4>
  262. <div class="list"><dl>
  263. <dt><var>$template_name</var></dt>
  264. <dd><code>string</code><br>$template_name the immutable name or slug of a template that exists in the
  265. user's account. For backwards-compatibility, the template name may also be used
  266. but the immutable slug is preferred.</dd>
  267. <dt><var>$template_content</var></dt>
  268. <dd><code>array</code><br>$template_content an array of template content to send. Each item in the array
  269. should be a struct with two keys - name: the name of the content block to set
  270. the content for, and content: the actual content to put into the block -
  271. template_content[] struct the injection of a single piece of content into a
  272. single editable region - name string the name of the mc:edit editable region to
  273. inject into - content string the content to inject</dd>
  274. <dt><var>$message</var></dt>
  275. <dd><code>struct</code><br>$message the other information on the message to send - same as /messages/send,
  276. but without the html content - html string optional full HTML content to be sent
  277. if not in template - text string optional full text content to be sent - subject
  278. string the message subject - from_email string the sender email address. -
  279. from_name string optional from name to be used - to array an array of recipient
  280. information. - to[] struct a single recipient's information. - email string the
  281. email address of the recipient - name string the optional display name to use
  282. for the recipient - type string the header type to use for the recipient,
  283. defaults to "to" if not provided - headers struct optional extra headers to add
  284. to the message (most headers are allowed) - important boolean whether or not
  285. this message is important, and should be delivered ahead of non-important
  286. messages - track_opens boolean whether or not to turn on open tracking for the
  287. message - track_clicks boolean whether or not to turn on click tracking for the
  288. message - auto_text boolean whether or not to automatically generate a text part
  289. for messages that are not given text - auto_html boolean whether or not to
  290. automatically generate an HTML part for messages that are not given HTML -
  291. inline_css boolean whether or not to automatically inline all CSS styles
  292. provided in the message HTML - only for HTML documents less than 256KB in size -
  293. url_strip_qs boolean whether or not to strip the query string from URLs when
  294. aggregating tracked URL data - preserve_recipients boolean whether or not to
  295. expose all recipients in to "To" header for each email - view_content_link
  296. boolean set to false to remove content logging for sensitive emails -
  297. bcc_address string an optional address to receive an exact copy of each
  298. recipient's email - tracking_domain string a custom domain to use for tracking
  299. opens and clicks instead of mandrillapp.com - signing_domain string a custom
  300. domain to use for SPF/DKIM signing instead of mandrill (for "via" or "on behalf
  301. of" in email clients) - return_path_domain string a custom domain to use for the
  302. messages's return-path - merge boolean whether to evaluate merge tags in the
  303. message. Will automatically be set to true if either merge_vars or
  304. global_merge_vars are provided. - global_merge_vars array global merge variables
  305. to use for all recipients. You can override these per recipient. -
  306. global_merge_vars[] struct a single global merge variable - name string the
  307. global merge variable's name. Merge variable names are case-insensitive and may
  308. not start with _ - content string the global merge variable's content -
  309. merge_vars array per-recipient merge variables, which override global merge
  310. variables with the same name. - merge_vars[] struct per-recipient merge
  311. variables - rcpt string the email address of the recipient that the merge
  312. variables should apply to - vars array the recipient's merge variables - vars[]
  313. struct a single merge variable - name string the merge variable's name. Merge
  314. variable names are case-insensitive and may not start with _ - content string
  315. the merge variable's content - tags array an array of string to tag the message
  316. with. Stats are accumulated using tags, though we only store the first 100 we
  317. see, so this should not be unique or change frequently. Tags should be 50
  318. characters or less. Any tags starting with an underscore are reserved for
  319. internal use and will cause errors. - tags[] string a single tag - must not
  320. start with an underscore - subaccount string the unique id of a subaccount for
  321. this message - must already exist or will fail with an error -
  322. google_analytics_domains array an array of strings indicating for which any
  323. matching URLs will automatically have Google Analytics parameters appended to
  324. their query string automatically. - google_analytics_campaign array|string
  325. optional string indicating the value to set for the utm_campaign tracking
  326. parameter. If this isn't provided the email's from address will be used instead.
  327. - metadata array metadata an associative array of user metadata. Mandrill will
  328. store this metadata and make it available for retrieval. In addition, you can
  329. select up to 10 metadata fields to index and make searchable using the Mandrill
  330. search api. - recipient_metadata array Per-recipient metadata that will override
  331. the global values specified in the metadata parameter. - recipient_metadata[]
  332. struct metadata for a single recipient - rcpt string the email address of the
  333. recipient that the metadata is associated with - values array an associated
  334. array containing the recipient's unique metadata. If a key exists in both the
  335. per-recipient metadata and the global metadata, the per-recipient metadata will
  336. be used. - attachments array an array of supported attachments to add to the
  337. message - attachments[] struct a single supported attachment - type string the
  338. MIME type of the attachment - name string the file name of the attachment -
  339. content string the content of the attachment as a base64-encoded string - images
  340. array an array of embedded images to add to the message - images[] struct a
  341. single embedded image - type string the MIME type of the image - must start with
  342. "image/" - name string the Content ID of the image - use &lt;img
  343. src="cid:THIS_VALUE"&gt; to reference the image in your HTML content - content
  344. string the content of the image as a base64-encoded string</dd>
  345. <dt><var>$async</var></dt>
  346. <dd><code>boolean</code><br>$async enable a background sending mode that is optimized for bulk sending. In
  347. async mode, messages/send will immediately return a status of "queued" for every
  348. recipient. To handle rejections when sending in async mode, set up a webhook for
  349. the 'reject' event. Defaults to false for messages with no more than 10
  350. recipients; messages with more than 10 recipients are always sent
  351. asynchronously, regardless of the value of async.</dd>
  352. <dt><var>$ip_pool</var></dt>
  353. <dd><code>string</code><br>$ip_pool the name of the dedicated ip pool that should be used to send the
  354. message. If you do not have any dedicated IPs, this parameter has no effect. If
  355. you specify a pool that does not exist, your default pool will be used instead.</dd>
  356. <dt><var>$send_at</var></dt>
  357. <dd><code>string</code><br>$send_at when this message should be sent as a UTC timestamp in YYYY-MM-DD
  358. HH:MM:SS format. If you specify a time in the past, the message will be sent
  359. immediately. An additional fee applies for scheduled email, and this feature is
  360. only available to accounts with a positive balance.</dd>
  361. </dl></div>
  362. <h4>Returns</h4>
  363. <div class="list">
  364. <code>array</code><br>of structs for each recipient containing the key "email" with the email address
  365. and "status" as either "sent", "queued", "scheduled", or "rejected" - return[]
  366. struct the sending results for a single recipient - email string the email
  367. address of the recipient - status string the sending status of the recipient -
  368. either "sent", "queued", "rejected", or "invalid" - reject_reason string the
  369. reason for the rejection if the recipient status is "rejected" - _id string the
  370. message's unique id<br />
  371. </div>
  372. </div>
  373. </div></td>
  374. </tr>
  375. <tr data-order="search" id="_search">
  376. <td class="attributes"><code>
  377. public
  378. array
  379. </code>
  380. </td>
  381. <td class="name"><div>
  382. <a class="anchor" href="#_search">#</a>
  383. <code><a href="source-class-Mandrill_Messages.html#161-206" title="Go to source code">search</a>( <span>string <var>$query</var> = <span class="php-quote">'*'</span></span>, <span>string <var>$date_from</var> = <span class="php-keyword1">null</span></span>, <span>string <var>$date_to</var> = <span class="php-keyword1">null</span></span>, <span>array <var>$tags</var> = <span class="php-keyword1">null</span></span>, <span>array <var>$senders</var> = <span class="php-keyword1">null</span></span>, <span>array <var>$api_keys</var> = <span class="php-keyword1">null</span></span>, <span>integer <var>$limit</var> = <span class="php-num">100</span></span> )</code>
  384. <div class="description short">
  385. <p>Search the content of recently sent messages and optionally narrow by date
  386. range, tags and senders</p>
  387. </div>
  388. <div class="description detailed hidden">
  389. <p>Search the content of recently sent messages and optionally narrow by date
  390. range, tags and senders</p>
  391. <h4>Parameters</h4>
  392. <div class="list"><dl>
  393. <dt><var>$query</var></dt>
  394. <dd><code>string</code><br>$query the search terms to find matching messages for</dd>
  395. <dt><var>$date_from</var></dt>
  396. <dd><code>string</code><br>$date_from start date</dd>
  397. <dt><var>$date_to</var></dt>
  398. <dd><code>string</code><br>$date_to end date</dd>
  399. <dt><var>$tags</var></dt>
  400. <dd><code>array</code><br>$tags an array of tag names to narrow the search to, will return messages that
  401. contain ANY of the tags</dd>
  402. <dt><var>$senders</var></dt>
  403. <dd><code>array</code><br>$senders an array of sender addresses to narrow the search to, will return
  404. messages sent by ANY of the senders</dd>
  405. <dt><var>$api_keys</var></dt>
  406. <dd><code>array</code><br>$api_keys an array of API keys to narrow the search to, will return messages
  407. sent by ANY of the keys</dd>
  408. <dt><var>$limit</var></dt>
  409. <dd><code>integer</code><br>$limit the maximum number of results to return, defaults to 100, 1000 is the
  410. maximum</dd>
  411. </dl></div>
  412. <h4>Returns</h4>
  413. <div class="list">
  414. <code>array</code><br>of structs for each matching message - return[] struct the information for a
  415. single matching message - ts integer the Unix timestamp from when this message
  416. was sent - _id string the message's unique id - sender string the email address
  417. of the sender - template string the unique name of the template used, if any -
  418. subject string the message's subject line - email string the recipient email
  419. address - tags array list of tags on this message - tags[] string individual tag
  420. on this message - opens integer how many times has this message been opened -
  421. opens_detail array list of individual opens for the message - opens_detail[]
  422. struct information on an individual open - ts integer the unix timestamp from
  423. when the message was opened - ip string the IP address that generated the open -
  424. location string the approximate region and country that the opening IP is
  425. located - ua string the email client or browser data of the open - clicks
  426. integer how many times has a link been clicked in this message - clicks_detail
  427. array list of individual clicks for the message - clicks_detail[] struct
  428. information on an individual click - ts integer the unix timestamp from when the
  429. message was clicked - url string the URL that was clicked on - ip string the IP
  430. address that generated the click - location string the approximate region and
  431. country that the clicking IP is located - ua string the email client or browser
  432. data of the click - state string sending status of this message: sent, bounced,
  433. rejected - metadata struct any custom metadata provided when the message was
  434. sent - smtp_events array a log of up to 3 smtp events for the message -
  435. smtp_events[] struct information about a specific smtp event - ts integer the
  436. Unix timestamp when the event occured - type string the message's state as a
  437. result of this event - diag string the SMTP response from the recipient's server<br />
  438. </div>
  439. </div>
  440. </div></td>
  441. </tr>
  442. <tr data-order="searchTimeSeries" id="_searchTimeSeries">
  443. <td class="attributes"><code>
  444. public
  445. array
  446. </code>
  447. </td>
  448. <td class="name"><div>
  449. <a class="anchor" href="#_searchTimeSeries">#</a>
  450. <code><a href="source-class-Mandrill_Messages.html#208-232" title="Go to source code">searchTimeSeries</a>( <span>string <var>$query</var> = <span class="php-quote">'*'</span></span>, <span>string <var>$date_from</var> = <span class="php-keyword1">null</span></span>, <span>string <var>$date_to</var> = <span class="php-keyword1">null</span></span>, <span>array <var>$tags</var> = <span class="php-keyword1">null</span></span>, <span>array <var>$senders</var> = <span class="php-keyword1">null</span></span> )</code>
  451. <div class="description short">
  452. <p>Search the content of recently sent messages and return the aggregated hourly
  453. stats for matching messages</p>
  454. </div>
  455. <div class="description detailed hidden">
  456. <p>Search the content of recently sent messages and return the aggregated hourly
  457. stats for matching messages</p>
  458. <h4>Parameters</h4>
  459. <div class="list"><dl>
  460. <dt><var>$query</var></dt>
  461. <dd><code>string</code><br>$query the search terms to find matching messages for</dd>
  462. <dt><var>$date_from</var></dt>
  463. <dd><code>string</code><br>$date_from start date</dd>
  464. <dt><var>$date_to</var></dt>
  465. <dd><code>string</code><br>$date_to end date</dd>
  466. <dt><var>$tags</var></dt>
  467. <dd><code>array</code><br>$tags an array of tag names to narrow the search to, will return messages that
  468. contain ANY of the tags</dd>
  469. <dt><var>$senders</var></dt>
  470. <dd><code>array</code><br>$senders an array of sender addresses to narrow the search to, will return
  471. messages sent by ANY of the senders</dd>
  472. </dl></div>
  473. <h4>Returns</h4>
  474. <div class="list">
  475. <code>array</code><br>the array of history information - return[] struct the stats for a single hour -
  476. time string the hour as a UTC date string in YYYY-MM-DD HH:MM:SS format - sent
  477. integer the number of emails that were sent during the hour - hard_bounces
  478. integer the number of emails that hard bounced during the hour - soft_bounces
  479. integer the number of emails that soft bounced during the hour - rejects integer
  480. the number of emails that were rejected during the hour - complaints integer the
  481. number of spam complaints received during the hour - unsubs integer the number
  482. of unsubscribes received during the hour - opens integer the number of emails
  483. opened during the hour - unique_opens integer the number of unique opens
  484. generated by messages sent during the hour - clicks integer the number of
  485. tracked URLs clicked during the hour - unique_clicks integer the number of
  486. unique clicks generated by messages sent during the hour<br />
  487. </div>
  488. </div>
  489. </div></td>
  490. </tr>
  491. <tr data-order="info" id="_info">
  492. <td class="attributes"><code>
  493. public
  494. struct
  495. </code>
  496. </td>
  497. <td class="name"><div>
  498. <a class="anchor" href="#_info">#</a>
  499. <code><a href="source-class-Mandrill_Messages.html#234-272" title="Go to source code">info</a>( <span>string <var>$id</var></span> )</code>
  500. <div class="description short">
  501. <p>Get the information for a single recently sent message</p>
  502. </div>
  503. <div class="description detailed hidden">
  504. <p>Get the information for a single recently sent message</p>
  505. <h4>Parameters</h4>
  506. <div class="list"><dl>
  507. <dt><var>$id</var></dt>
  508. <dd><code>string</code><br>$id the unique id of the message to get - passed as the "_id" field in webhooks,
  509. send calls, or search calls</dd>
  510. </dl></div>
  511. <h4>Returns</h4>
  512. <div class="list">
  513. <code>struct</code><br>the information for the message - ts integer the Unix timestamp from when this
  514. message was sent - _id string the message's unique id - sender string the email
  515. address of the sender - template string the unique name of the template used, if
  516. any - subject string the message's subject line - email string the recipient
  517. email address - tags array list of tags on this message - tags[] string
  518. individual tag on this message - opens integer how many times has this message
  519. been opened - opens_detail array list of individual opens for the message -
  520. opens_detail[] struct information on an individual open - ts integer the unix
  521. timestamp from when the message was opened - ip string the IP address that
  522. generated the open - location string the approximate region and country that the
  523. opening IP is located - ua string the email client or browser data of the open -
  524. clicks integer how many times has a link been clicked in this message -
  525. clicks_detail array list of individual clicks for the message - clicks_detail[]
  526. struct information on an individual click - ts integer the unix timestamp from
  527. when the message was clicked - url string the URL that was clicked on - ip
  528. string the IP address that generated the click - location string the approximate
  529. region and country that the clicking IP is located - ua string the email client
  530. or browser data of the click - state string sending status of this message:
  531. sent, bounced, rejected - metadata struct any custom metadata provided when the
  532. message was sent - smtp_events array a log of up to 3 smtp events for the
  533. message - smtp_events[] struct information about a specific smtp event - ts
  534. integer the Unix timestamp when the event occured - type string the message's
  535. state as a result of this event - diag string the SMTP response from the
  536. recipient's server<br />
  537. </div>
  538. </div>
  539. </div></td>
  540. </tr>
  541. <tr data-order="content" id="_content">
  542. <td class="attributes"><code>
  543. public
  544. struct
  545. </code>
  546. </td>
  547. <td class="name"><div>
  548. <a class="anchor" href="#_content">#</a>
  549. <code><a href="source-class-Mandrill_Messages.html#274-300" title="Go to source code">content</a>( <span>string <var>$id</var></span> )</code>
  550. <div class="description short">
  551. <p>Get the full content of a recently sent message</p>
  552. </div>
  553. <div class="description detailed hidden">
  554. <p>Get the full content of a recently sent message</p>
  555. <h4>Parameters</h4>
  556. <div class="list"><dl>
  557. <dt><var>$id</var></dt>
  558. <dd><code>string</code><br>$id the unique id of the message to get - passed as the "_id" field in webhooks,
  559. send calls, or search calls</dd>
  560. </dl></div>
  561. <h4>Returns</h4>
  562. <div class="list">
  563. <code>struct</code><br>the content of the message - ts integer the Unix timestamp from when this
  564. message was sent - _id string the message's unique id - from_email string the
  565. email address of the sender - from_name string the alias of the sender (if any)
  566. - subject string the message's subject line - to struct the message recipient's
  567. information - email string the email address of the recipient - name string the
  568. alias of the recipient (if any) - tags array list of tags on this message -
  569. tags[] string individual tag on this message - headers struct the key-value
  570. pairs of the custom MIME headers for the message's main document - text string
  571. the text part of the message, if any - html string the HTML part of the message,
  572. if any - attachments array an array of any attachments that can be found in the
  573. message - attachments[] struct information about an individual attachment - name
  574. string the file name of the attachment - type string the MIME type of the
  575. attachment - content string the content of the attachment as a base64 encoded
  576. string<br />
  577. </div>
  578. </div>
  579. </div></td>
  580. </tr>
  581. <tr data-order="parse" id="_parse">
  582. <td class="attributes"><code>
  583. public
  584. struct
  585. </code>
  586. </td>
  587. <td class="name"><div>
  588. <a class="anchor" href="#_parse">#</a>
  589. <code><a href="source-class-Mandrill_Messages.html#302-331" title="Go to source code">parse</a>( <span>string <var>$raw_message</var></span> )</code>
  590. <div class="description short">
  591. <p>Parse the full MIME document for an email message, returning the content of
  592. the message broken into its constituent pieces</p>
  593. </div>
  594. <div class="description detailed hidden">
  595. <p>Parse the full MIME document for an email message, returning the content of
  596. the message broken into its constituent pieces</p>
  597. <h4>Parameters</h4>
  598. <div class="list"><dl>
  599. <dt><var>$raw_message</var></dt>
  600. <dd><code>string</code><br>$raw_message the full MIME document of an email message</dd>
  601. </dl></div>
  602. <h4>Returns</h4>
  603. <div class="list">
  604. <code>struct</code><br>the parsed message - subject string the subject of the message - from_email
  605. string the email address of the sender - from_name string the alias of the
  606. sender (if any) - to array an array of any recipients in the message - to[]
  607. struct the information on a single recipient - email string the email address of
  608. the recipient - name string the alias of the recipient (if any) - headers struct
  609. the key-value pairs of the MIME headers for the message's main document - text
  610. string the text part of the message, if any - html string the HTML part of the
  611. message, if any - attachments array an array of any attachments that can be
  612. found in the message - attachments[] struct information about an individual
  613. attachment - name string the file name of the attachment - type string the MIME
  614. type of the attachment - binary boolean if this is set to true, the attachment
  615. is not pure-text, and the content will be base64 encoded - content string the
  616. content of the attachment as a text string or a base64 encoded string based on
  617. the attachment type - images array an array of any embedded images that can be
  618. found in the message - images[] struct information about an individual image -
  619. name string the Content-ID of the embedded image - type string the MIME type of
  620. the image - content string the content of the image as a base64 encoded string<br />
  621. </div>
  622. </div>
  623. </div></td>
  624. </tr>
  625. <tr data-order="sendRaw" id="_sendRaw">
  626. <td class="attributes"><code>
  627. public
  628. array
  629. </code>
  630. </td>
  631. <td class="name"><div>
  632. <a class="anchor" href="#_sendRaw">#</a>
  633. <code><a href="source-class-Mandrill_Messages.html#333-354" title="Go to source code">sendRaw</a>( <span>string <var>$raw_message</var></span>, <span>string|null <var>$from_email</var> = <span class="php-keyword1">null</span></span>, <span>string|null <var>$from_name</var> = <span class="php-keyword1">null</span></span>, <span>array|null <var>$to</var> = <span class="php-keyword1">null</span></span>, <span>boolean <var>$async</var> = <span class="php-keyword1">false</span></span>, <span>string <var>$ip_pool</var> = <span class="php-keyword1">null</span></span>, <span>string <var>$send_at</var> = <span class="php-keyword1">null</span></span>, <span>string <var>$return_path_domain</var> = <span class="php-keyword1">null</span></span> )</code>
  634. <div class="description short">
  635. <p>Take a raw MIME document for a message, and send it exactly as if it were
  636. sent through Mandrill's SMTP servers</p>
  637. </div>
  638. <div class="description detailed hidden">
  639. <p>Take a raw MIME document for a message, and send it exactly as if it were
  640. sent through Mandrill's SMTP servers</p>
  641. <h4>Parameters</h4>
  642. <div class="list"><dl>
  643. <dt><var>$raw_message</var></dt>
  644. <dd><code>string</code><br>$raw_message the full MIME document of an email message</dd>
  645. <dt><var>$from_email</var></dt>
  646. <dd><code>string|null</code><br>$from_email optionally define the sender address - otherwise we'll use the
  647. address found in the provided headers</dd>
  648. <dt><var>$from_name</var></dt>
  649. <dd><code>string|null</code><br>$from_name optionally define the sender alias</dd>
  650. <dt><var>$to</var></dt>
  651. <dd><code>array|null</code><br>$to optionally define the recipients to receive the message - otherwise we'll
  652. use the To, Cc, and Bcc headers provided in the document - to[] string the email
  653. address of the recipient</dd>
  654. <dt><var>$async</var></dt>
  655. <dd><code>boolean</code><br>$async enable a background sending mode that is optimized for bulk sending. In
  656. async mode, messages/sendRaw will immediately return a status of "queued" for
  657. every recipient. To handle rejections when sending in async mode, set up a
  658. webhook for the 'reject' event. Defaults to false for messages with no more than
  659. 10 recipients; messages with more than 10 recipients are always sent
  660. asynchronously, regardless of the value of async.</dd>
  661. <dt><var>$ip_pool</var></dt>
  662. <dd><code>string</code><br>$ip_pool the name of the dedicated ip pool that should be used to send the
  663. message. If you do not have any dedicated IPs, this parameter has no effect. If
  664. you specify a pool that does not exist, your default pool will be used instead.</dd>
  665. <dt><var>$send_at</var></dt>
  666. <dd><code>string</code><br>$send_at when this message should be sent as a UTC timestamp in YYYY-MM-DD
  667. HH:MM:SS format. If you specify a time in the past, the message will be sent
  668. immediately.</dd>
  669. <dt><var>$return_path_domain</var></dt>
  670. <dd><code>string</code><br>$return_path_domain a custom domain to use for the messages's return-path</dd>
  671. </dl></div>
  672. <h4>Returns</h4>
  673. <div class="list">
  674. <code>array</code><br>of structs for each recipient containing the key "email" with the email address
  675. and "status" as either "sent", "queued", or "rejected" - return[] struct the
  676. sending results for a single recipient - email string the email address of the
  677. recipient - status string the sending status of the recipient - either "sent",
  678. "queued", "scheduled", "rejected", or "invalid" - reject_reason string the
  679. reason for the rejection if the recipient status is "rejected" - _id string the
  680. message's unique id<br />
  681. </div>
  682. </div>
  683. </div></td>
  684. </tr>
  685. <tr data-order="listScheduled" id="_listScheduled">
  686. <td class="attributes"><code>
  687. public
  688. array
  689. </code>
  690. </td>
  691. <td class="name"><div>
  692. <a class="anchor" href="#_listScheduled">#</a>
  693. <code><a href="source-class-Mandrill_Messages.html#356-371" title="Go to source code">listScheduled</a>( <span>string <var>$to</var> = <span class="php-keyword1">null</span></span> )</code>
  694. <div class="description short">
  695. <p>Queries your scheduled emails by sender or recipient, or both.</p>
  696. </div>
  697. <div class="description detailed hidden">
  698. <p>Queries your scheduled emails by sender or recipient, or both.</p>
  699. <h4>Parameters</h4>
  700. <div class="list"><dl>
  701. <dt><var>$to</var></dt>
  702. <dd><code>string</code><br>$to an optional recipient address to restrict results to</dd>
  703. </dl></div>
  704. <h4>Returns</h4>
  705. <div class="list">
  706. <code>array</code><br>a list of up to 1000 scheduled emails - return[] struct a scheduled email - _id
  707. string the scheduled message id - created_at string the UTC timestamp when the
  708. message was created, in YYYY-MM-DD HH:MM:SS format - send_at string the UTC
  709. timestamp when the message will be sent, in YYYY-MM-DD HH:MM:SS format -
  710. from_email string the email's sender address - to string the email's recipient -
  711. subject string the email's subject<br />
  712. </div>
  713. </div>
  714. </div></td>
  715. </tr>
  716. <tr data-order="cancelScheduled" id="_cancelScheduled">
  717. <td class="attributes"><code>
  718. public
  719. struct
  720. </code>
  721. </td>
  722. <td class="name"><div>
  723. <a class="anchor" href="#_cancelScheduled">#</a>
  724. <code><a href="source-class-Mandrill_Messages.html#373-387" title="Go to source code">cancelScheduled</a>( <span>string <var>$id</var></span> )</code>
  725. <div class="description short">
  726. <p>Cancels a scheduled email.</p>
  727. </div>
  728. <div class="description detailed hidden">
  729. <p>Cancels a scheduled email.</p>
  730. <h4>Parameters</h4>
  731. <div class="list"><dl>
  732. <dt><var>$id</var></dt>
  733. <dd><code>string</code><br>$id a scheduled email id, as returned by any of the messages/send calls or
  734. messages/list-scheduled</dd>
  735. </dl></div>
  736. <h4>Returns</h4>
  737. <div class="list">
  738. <code>struct</code><br>information about the scheduled email that was cancelled. - _id string the
  739. scheduled message id - created_at string the UTC timestamp when the message was
  740. created, in YYYY-MM-DD HH:MM:SS format - send_at string the UTC timestamp when
  741. the message will be sent, in YYYY-MM-DD HH:MM:SS format - from_email string the
  742. email's sender address - to string the email's recipient - subject string the
  743. email's subject<br />
  744. </div>
  745. </div>
  746. </div></td>
  747. </tr>
  748. <tr data-order="reschedule" id="_reschedule">
  749. <td class="attributes"><code>
  750. public
  751. struct
  752. </code>
  753. </td>
  754. <td class="name"><div>
  755. <a class="anchor" href="#_reschedule">#</a>
  756. <code><a href="source-class-Mandrill_Messages.html#389-404" title="Go to source code">reschedule</a>( <span>string <var>$id</var></span>, <span>string <var>$send_at</var></span> )</code>
  757. <div class="description short">
  758. <p>Reschedules a scheduled email.</p>
  759. </div>
  760. <div class="description detailed hidden">
  761. <p>Reschedules a scheduled email.</p>
  762. <h4>Parameters</h4>
  763. <div class="list"><dl>
  764. <dt><var>$id</var></dt>
  765. <dd><code>string</code><br>$id a scheduled email id, as returned by any of the messages/send calls or
  766. messages/list-scheduled</dd>
  767. <dt><var>$send_at</var></dt>
  768. <dd><code>string</code><br>$send_at the new UTC timestamp when the message should sent. Mandrill can't time
  769. travel, so if you specify a time in past the message will be sent immediately</dd>
  770. </dl></div>
  771. <h4>Returns</h4>
  772. <div class="list">
  773. <code>struct</code><br>information about the scheduled email that was rescheduled. - _id string the
  774. scheduled message id - created_at string the UTC timestamp when the message was
  775. created, in YYYY-MM-DD HH:MM:SS format - send_at string the UTC timestamp when
  776. the message will be sent, in YYYY-MM-DD HH:MM:SS format - from_email string the
  777. email's sender address - to string the email's recipient - subject string the
  778. email's subject<br />
  779. </div>
  780. </div>
  781. </div></td>
  782. </tr>
  783. </table>
  784. </div>
  785. <div id="footer">
  786. API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
  787. </div>
  788. </div>
  789. </div>
  790. </body>
  791. </html>