{"id":492,"date":"2018-01-26T09:49:44","date_gmt":"2018-01-26T04:19:44","guid":{"rendered":"https:\/\/www.huntbee.com\/resources\/docs\/email-template-designer-pro\/developer\/"},"modified":"2022-08-26T12:36:10","modified_gmt":"2022-08-26T07:06:10","slug":"developer","status":"publish","type":"docs","link":"https:\/\/www.huntbee.com\/resources\/docs\/email-template-designer-pro\/developer\/","title":{"rendered":"Developer"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>This article is only for developers<\/p><\/blockquote>\n\n\n\n<p>If you are creating a custom extension and would like to use the email templates created using this extension, you can add the following code appropriately.<\/p>\n\n\n\n<p><strong>FOR CATALOG<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$this-&gt;load-&gt;model('extension\/module\/email_builder'); <span style=\"color: #ffa500;\">\/\/Load the model file once<\/span>\n$template_id = '<strong><span style=\"color: #008080;\">1<\/span><\/strong>'; <span style=\"color: #ff8c00;\">\/\/Mention template ID<\/span>\n\n$template_data = $this-&gt;model_extension_module_email_builder-&gt;builtTemplate($template_id);\n$to = '<strong><span style=\"color: #008080;\">yourstoreemail@store.com<\/span><\/strong>'; <span style=\"color: #ffa500;\">\/\/ Add sender email here <\/span>        \n\n$email_data = array(          \n        'to'              =&gt; $to,             \n        'from'            =&gt; $template_data['email_options']['sender_email'],\n        'store_name'      =&gt; $template_data['email_options']['sender_name'],\n        'email_replyto'   =&gt; $template_data['email_options']['email_replyto'],\n        'subject'         =&gt; $template_data['email_options']['email_subject'],\n        'content'         =&gt; $template_data['email_content'],\n        'attachments'     =&gt; (isset($template_data['email_options']['email_attachments']))? $template_data['email_options']['email_attachments']: '',\n        'bcc'             =&gt; $template_data['email_options']['email_bcc'],\n        'template_id'     =&gt; $template_id,\n        'store_id'        =&gt; $template_data['store_id'],\n        'type'            =&gt; (isset($template_data['email_options']['email_type_id']))? $template_data['email_options']['email_type_id']: '0', <span style=\"color: #ff8c00;\">\/\/set email type id to categorize the email for your reference<\/span>\n        'cron'            =&gt; false <span style=\"color: #ff8c00;\">\/\/set to <strong>true<\/strong> if you want to enable cron mode<\/span>\n    );\n\n$this-&gt;model_extension_module_email_builder-&gt;sendemail($email_data);<\/pre>\n\n\n\n<p><strong>FOR ADMIN<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$this-&gt;load-&gt;model('extension\/hbapps\/email_builder'); <span style=\"color: #ffa500;\">\/\/Load the model file once<\/span>\n$template_id = '<strong><span style=\"color: #008080;\">1<\/span><\/strong>'; <span style=\"color: #ff8c00;\">\/\/Mention template ID<\/span>\n\n$template_data = $this-&gt;model_extension_hbapps_email_builder-&gt;builtTemplate($template_id);\n$to = '<strong><span style=\"color: #008080;\">yourstoreemail@store.com<\/span><\/strong>'; <span style=\"color: #ffa500;\">\/\/ Add sender email here <\/span>        \n\n$email_data = array(          \n        'to'              =&gt; $to,             \n        'from'            =&gt; $template_data['email_options']['sender_email'],\n        'store_name'      =&gt; $template_data['email_options']['sender_name'],\n        'email_replyto'   =&gt; $template_data['email_options']['email_replyto'],\n        'subject'         =&gt; $template_data['email_options']['email_subject'],\n        'content'         =&gt; $template_data['email_content'],\n        'attachments'     =&gt; (isset($template_data['email_options']['email_attachments']))? $template_data['email_options']['email_attachments']: '',\n        'bcc'             =&gt; $template_data['email_options']['email_bcc'],\n        'template_id'     =&gt; $template_id,\n        'store_id'        =&gt; $template_data['store_id'],\n        'type'            =&gt; (isset($template_data['email_options']['email_type_id']))? $template_data['email_options']['email_type_id']: '0', <span style=\"color: #ff8c00;\">\/\/set email type id to categorize the email for your reference<\/span>\n        'cron'            =&gt; false <span style=\"color: #ff8c00;\">\/\/set to <strong>true<\/strong> if you want to enable cron mode<\/span>\n    );\n\n$this-&gt;model_extension_hbapps_email_builder-&gt;sendemail($email_data);<\/pre>\n","protected":false},"featured_media":0,"parent":467,"menu_order":11,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-492","docs","type-docs","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Developer - HuntBee Resources<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.huntbee.com\/resources\/docs\/email-template-designer-pro\/developer\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Developer - HuntBee Resources\" \/>\n<meta property=\"og:description\" content=\"This article is only for developers If you are creating a custom extension and would like to use the email templates created using this extension, you can add the following code appropriately. FOR CATALOG $this-&gt;load-&gt;model(&#039;extension\/module\/email_builder&#039;); \/\/Load the model file once $template_id = &#039;1&#039;; \/\/Mention template ID $template_data = $this-&gt;model_extension_module_email_builder-&gt;builtTemplate($template_id); $to = &#039;yourstoreemail@store.com&#039;; \/\/ Add sender [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.huntbee.com\/resources\/docs\/email-template-designer-pro\/developer\/\" \/>\n<meta property=\"og:site_name\" content=\"HuntBee Resources\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/huntbee.opencart\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-26T07:06:10+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/docs\\\/email-template-designer-pro\\\/developer\\\/\",\"url\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/docs\\\/email-template-designer-pro\\\/developer\\\/\",\"name\":\"Developer - HuntBee Resources\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/#website\"},\"datePublished\":\"2018-01-26T04:19:44+00:00\",\"dateModified\":\"2022-08-26T07:06:10+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/docs\\\/email-template-designer-pro\\\/developer\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/docs\\\/email-template-designer-pro\\\/developer\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/docs\\\/email-template-designer-pro\\\/developer\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Email Template Designer Pro\",\"item\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/docs\\\/email-template-designer-pro\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Developer\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/#website\",\"url\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/\",\"name\":\"HuntBee Resources\",\"description\":\"OpenCart Extension Documentations - Guides - Blogs - Projects\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/#organization\",\"name\":\"HuntBee OpenCart\",\"url\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/cropped-mobile-logo-new.png\",\"contentUrl\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/cropped-mobile-logo-new.png\",\"width\":945,\"height\":200,\"caption\":\"HuntBee OpenCart\"},\"image\":{\"@id\":\"https:\\\/\\\/www.huntbee.com\\\/resources\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/huntbee.opencart\",\"https:\\\/\\\/www.instagram.com\\\/opencart.huntbee\\\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Developer - HuntBee Resources","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.huntbee.com\/resources\/docs\/email-template-designer-pro\/developer\/","og_locale":"en_US","og_type":"article","og_title":"Developer - HuntBee Resources","og_description":"This article is only for developers If you are creating a custom extension and would like to use the email templates created using this extension, you can add the following code appropriately. FOR CATALOG $this-&gt;load-&gt;model('extension\/module\/email_builder'); \/\/Load the model file once $template_id = '1'; \/\/Mention template ID $template_data = $this-&gt;model_extension_module_email_builder-&gt;builtTemplate($template_id); $to = 'yourstoreemail@store.com'; \/\/ Add sender [&hellip;]","og_url":"https:\/\/www.huntbee.com\/resources\/docs\/email-template-designer-pro\/developer\/","og_site_name":"HuntBee Resources","article_publisher":"https:\/\/www.facebook.com\/huntbee.opencart","article_modified_time":"2022-08-26T07:06:10+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.huntbee.com\/resources\/docs\/email-template-designer-pro\/developer\/","url":"https:\/\/www.huntbee.com\/resources\/docs\/email-template-designer-pro\/developer\/","name":"Developer - HuntBee Resources","isPartOf":{"@id":"https:\/\/www.huntbee.com\/resources\/#website"},"datePublished":"2018-01-26T04:19:44+00:00","dateModified":"2022-08-26T07:06:10+00:00","breadcrumb":{"@id":"https:\/\/www.huntbee.com\/resources\/docs\/email-template-designer-pro\/developer\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.huntbee.com\/resources\/docs\/email-template-designer-pro\/developer\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.huntbee.com\/resources\/docs\/email-template-designer-pro\/developer\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.huntbee.com\/resources\/"},{"@type":"ListItem","position":2,"name":"Email Template Designer Pro","item":"https:\/\/www.huntbee.com\/resources\/docs\/email-template-designer-pro\/"},{"@type":"ListItem","position":3,"name":"Developer"}]},{"@type":"WebSite","@id":"https:\/\/www.huntbee.com\/resources\/#website","url":"https:\/\/www.huntbee.com\/resources\/","name":"HuntBee Resources","description":"OpenCart Extension Documentations - Guides - Blogs - Projects","publisher":{"@id":"https:\/\/www.huntbee.com\/resources\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.huntbee.com\/resources\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.huntbee.com\/resources\/#organization","name":"HuntBee OpenCart","url":"https:\/\/www.huntbee.com\/resources\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.huntbee.com\/resources\/#\/schema\/logo\/image\/","url":"https:\/\/www.huntbee.com\/resources\/wp-content\/uploads\/2020\/04\/cropped-mobile-logo-new.png","contentUrl":"https:\/\/www.huntbee.com\/resources\/wp-content\/uploads\/2020\/04\/cropped-mobile-logo-new.png","width":945,"height":200,"caption":"HuntBee OpenCart"},"image":{"@id":"https:\/\/www.huntbee.com\/resources\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/huntbee.opencart","https:\/\/www.instagram.com\/opencart.huntbee\/"]}]}},"comment_count":0,"_links":{"self":[{"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/docs\/492","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/comments?post=492"}],"version-history":[{"count":17,"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/docs\/492\/revisions"}],"predecessor-version":[{"id":2853,"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/docs\/492\/revisions\/2853"}],"up":[{"embeddable":true,"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/docs\/467"}],"next":[{"title":"Troubleshooting","link":"https:\/\/www.huntbee.com\/resources\/docs\/email-template-designer-pro\/troubleshooting\/","href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/docs\/1036"}],"prev":[{"title":"Account Activation with Auto Verification Email","link":"https:\/\/www.huntbee.com\/resources\/docs\/email-template-designer-pro\/account-activation-with-auto-verification-email\/","href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/docs\/2051"}],"wp:attachment":[{"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/media?parent=492"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.huntbee.com\/resources\/wp-json\/wp\/v2\/doc_tag?post=492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}