PageRenderTime 46ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.1-1.6.0.2.php

https://gitlab.com/LisovyiEvhenii/ismextensions
PHP | 288 lines | 255 code | 8 blank | 25 comment | 0 complexity | 888b0e1cbdd1d55dee197b4d91370314 MD5 | raw file
  1. <?php
  2. /**
  3. * Magento
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Open Software License (OSL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/osl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@magento.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade Magento to newer
  18. * versions in the future. If you wish to customize Magento for your
  19. * needs please refer to http://www.magento.com for more information.
  20. *
  21. * @category Mage
  22. * @package Mage_Newsletter
  23. * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
  24. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  25. */
  26. /* @var $installer Mage_Core_Model_Resource_Setup */
  27. $installer = $this;
  28. $newsletterContent = <<<EOD
  29. {{template config_path="design/email/header"}}
  30. {{inlinecss file="email-inline.css"}}
  31. <table cellpadding="0" cellspacing="0" border="0">
  32. <tr>
  33. <td class="full">
  34. <table class="columns">
  35. <tr>
  36. <td class="email-heading">
  37. <h1>Welcome</h1>
  38. <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit,
  39. sed do eiusmod tempor incididunt ut labore et.</p>
  40. </td>
  41. <td class="store-info">
  42. <h4>Contact Us</h4>
  43. <p>
  44. {{depend store_phone}}
  45. <b>Call Us:</b>
  46. <a href="tel:{{var phone}}">{{var store_phone}}</a><br>
  47. {{/depend}}
  48. {{depend store_hours}}
  49. <span class="no-link">{{var store_hours}}</span><br>
  50. {{/depend}}
  51. {{depend store_email}}
  52. <b>Email:</b> <a href="mailto:{{var store_email}}">{{var store_email}}</a>
  53. {{/depend}}
  54. </p>
  55. </td>
  56. </tr>
  57. </table>
  58. </td>
  59. </tr>
  60. <tr>
  61. <td class="full">
  62. <table class="columns">
  63. <tr>
  64. <td>
  65. <img width="600" src="http://placehold.it/600x200" class="main-image">
  66. </td>
  67. <td class="expander"></td>
  68. </tr>
  69. </table>
  70. <table class="columns">
  71. <tr>
  72. <td class="panel">
  73. <p>Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra
  74. vitae. <a href="#">Click it! &raquo;</a></p>
  75. </td>
  76. <td class="expander"></td>
  77. </tr>
  78. </table>
  79. </td>
  80. </tr>
  81. <tr>
  82. <td>
  83. <table class="row">
  84. <tr>
  85. <td class="half left wrapper">
  86. <table class="columns">
  87. <tr>
  88. <td>
  89. <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
  90. incididunt ut labore et. Lorem ipsum dolor sit amet, consectetur adipisicing elit,
  91. sed do eiusmod tempor incididunt ut labore et. Lorem ipsum dolor sit amet.</p>
  92. <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
  93. incididunt ut labore et. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed
  94. do eiusmod tempor incididunt ut labore et. Lorem ipsum dolor sit amet.</p>
  95. <table class="button">
  96. <tr>
  97. <td>
  98. <a href="#">Click Me!</a>
  99. </td>
  100. </tr>
  101. </table>
  102. </td>
  103. <td class="expander"></td>
  104. </tr>
  105. </table>
  106. </td>
  107. <td class="half right wrapper last">
  108. <table class="columns">
  109. <tr>
  110. <td class="panel sidebar-links">
  111. <h6>Header Thing</h6>
  112. <p>Sub-head or something</p>
  113. <table>
  114. <tr>
  115. <td>
  116. <p><a href="#">Just a Plain Link &raquo;</a></p>
  117. </td>
  118. </tr>
  119. <tr>
  120. <td>
  121. <hr/>
  122. </td>
  123. </tr>
  124. <tr>
  125. <td>
  126. <p><a href="#">Just a Plain Link &raquo;</a></p>
  127. </td>
  128. </tr>
  129. <tr>
  130. <td>
  131. <hr/>
  132. </td>
  133. </tr>
  134. <tr>
  135. <td>
  136. <p><a href="#">Just a Plain Link &raquo;</a></p>
  137. </td>
  138. </tr>
  139. <tr>
  140. <td>
  141. <hr/>
  142. </td>
  143. </tr>
  144. <tr>
  145. <td>
  146. <p><a href="#">Just a Plain Link &raquo;</a></p>
  147. </td>
  148. </tr>
  149. <tr>
  150. <td>
  151. <hr/>
  152. </td>
  153. </tr>
  154. <tr>
  155. <td>
  156. <p><a href="#">Just a Plain Link &raquo;</a></p>
  157. </td>
  158. </tr>
  159. <tr>
  160. <td>
  161. <hr/>
  162. </td>
  163. </tr>
  164. <tr>
  165. <td>
  166. <p><a href="#">Just a Plain Link &raquo;</a></p>
  167. </td>
  168. </tr>
  169. <tr>
  170. <td>
  171. <hr/>
  172. </td>
  173. </tr>
  174. <tr>
  175. <td>
  176. <p><a href="#">Just a Plain Link &raquo;</a></p>
  177. </td>
  178. </tr>
  179. <tr><td>&nbsp;</td></tr>
  180. </table>
  181. </td>
  182. <td class="expander"></td>
  183. </tr>
  184. </table>
  185. <br>
  186. <table class="columns">
  187. <tr>
  188. <td class="panel">
  189. <h6>Connect With Us:</h6>
  190. <table class="social-button facebook">
  191. <tr>
  192. <td>
  193. <a href="#">Facebook</a>
  194. </td>
  195. </tr>
  196. </table>
  197. <hr>
  198. <table class="social-button twitter">
  199. <tr>
  200. <td>
  201. <a href="#">Twitter</a>
  202. </td>
  203. </tr>
  204. </table>
  205. <hr>
  206. <table class="social-button google-plus">
  207. <tr>
  208. <td>
  209. <a href="#">Google +</a>
  210. </td>
  211. </tr>
  212. </table>
  213. <br>
  214. <h6>Contact Info:</h6>
  215. {{depend store_phone}}
  216. <p>
  217. <b>Call Us:</b>
  218. <a href="tel:{{var phone}}">{{var store_phone}}</a>
  219. </p>
  220. {{/depend}}
  221. {{depend store_hours}}
  222. <p><span class="no-link">{{var store_hours}}</span><br></p>
  223. {{/depend}}
  224. {{depend store_email}}
  225. <p><b>Email:</b> <a href="mailto:{{var store_email}}">{{var store_email}}</a></p>
  226. {{/depend}}
  227. </td>
  228. <td class="expander"></td>
  229. </tr>
  230. </table>
  231. </td>
  232. </tr>
  233. </table>
  234. <table class="row">
  235. <tr>
  236. <td class="full wrapper">
  237. {{block type="catalog/product_new" template="email/catalog/product/new.phtml" products_count="4"
  238. column_count="4" }}
  239. </td>
  240. </tr>
  241. </table>
  242. <table class="row">
  243. <tr>
  244. <td class="full wrapper last">
  245. <table class="columns">
  246. <tr>
  247. <td align="center">
  248. <center>
  249. <p><a href="#">Terms</a> | <a href="#">Privacy</a> | <a href="#">Unsubscribe</a></p>
  250. </center>
  251. </td>
  252. <td class="expander"></td>
  253. </tr>
  254. </table>
  255. </td>
  256. </tr>
  257. </table>
  258. </td>
  259. </tr>
  260. </table>
  261. {{template config_path="design/email/footer"}}
  262. EOD;
  263. $data = array(
  264. 'template_code' => 'Example Newsletter Template',
  265. 'template_text' => $newsletterContent ,
  266. 'template_styles' => NULL,
  267. 'template_type' => Mage_Newsletter_Model_Template::TYPE_HTML,
  268. 'template_subject' => 'Example Subject',
  269. 'template_sender_name' => Mage::getStoreConfig('trans_email/ident_general/name'),
  270. 'template_sender_email' => Mage::getStoreConfig('trans_email/ident_general/email'),
  271. 'template_actual' => 1,
  272. 'added_at' => Mage::getSingleton('core/date')->gmtDate(),
  273. 'modified_at' => Mage::getSingleton('core/date')->gmtDate()
  274. );
  275. $model = Mage::getModel('newsletter/template')->setData($data);
  276. try {
  277. $model->save();
  278. } catch (Exception $e){
  279. Mage::logException($e->getMessage());
  280. }