[Skip to main content](#vessel-content)

#   Use RegularLabs snippets in email

##

- **[Thrane](/forum/user/31786-thrane "View Thrane's Profile")**
- [![Thrane's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31786-thrane "View Thrane's Profile") Topic Author
- [ Offline](/forum/user/31786-thrane)

Less More

- Posts: 366
- Thank you received: 26
-
-

5 years 9 months ago [\#329051](#329051) by [Thrane](/forum/user/31786-thrane "View Thrane's Profile")  *[Use RegularLabs snippets in email](/forum/27-checkout/901820-use-regularlabs-snippets-in-email#329051 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.4  Hi  Is there any way I can use Snippets from RegularLabs in the emails sent to the customer?   regularlabs.com/extensions/snippets  I tried adding the snippet to the emails, but I don't get any output.  Kind regards Thomas")* was created by *[Thrane](/forum/user/31786-thrane "View Thrane's Profile")*

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.24
-- PHP version -- : 7.4

Hi

Is there any way I can use Snippets from RegularLabs in the emails sent to the customer?
[ regularlabs.com/extensions/snippets](https://regularlabs.com/extensions/snippets)

I tried adding the snippet to the emails, but I don't get any output.

Kind regards
Thomas

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTgyMC11c2UtcmVndWxhcmxhYnMtc25pcHBldHMtaW4tZW1haWw/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

5 years 9 months ago [\#329094](#329094) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Use RegularLabs snippets in email](/forum/27-checkout/901820-use-regularlabs-snippets-in-email#329094 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.4  Hi  Is there any way I can use Snippets from RegularLabs in the emails sent to the customer?   regularlabs.com/extensions/snippets  I tried adding the snippet to the emails, but I don't get any output.  Kind regards Thomas")*

Hi,

You can but you need to add a bit of PHP around the tag, like that: Code:

&lt;?php echo JHTML::_('content.prepare','{snippet my-first-snippet}'); ?&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTgyMC11c2UtcmVndWxhcmxhYnMtc25pcHBldHMtaW4tZW1haWw/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Thrane](/forum/user/31786-thrane "View Thrane's Profile")**
- [![Thrane's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31786-thrane "View Thrane's Profile") Topic Author
- [ Offline](/forum/user/31786-thrane)

Less More

- Posts: 366
- Thank you received: 26
-
-

5 years 9 months ago [\#329097](#329097) by [Thrane](/forum/user/31786-thrane "View Thrane's Profile")  Replied by *[Thrane](/forum/user/31786-thrane "View Thrane's Profile")* on topic *[Use RegularLabs snippets in email](/forum/27-checkout/901820-use-regularlabs-snippets-in-email#329097 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.4  Hi  Is there any way I can use Snippets from RegularLabs in the emails sent to the customer?   regularlabs.com/extensions/snippets  I tried adding the snippet to the emails, but I don't get any output.  Kind regards Thomas")*

Thanks ...

Tried in Order status notification in the HTML version
&lt;?php echo JHTML::_('content.prepare','{snippet handelsbetingelser}'); ?&gt;

But I don't get anything in the email?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTgyMC11c2UtcmVndWxhcmxhYnMtc25pcHBldHMtaW4tZW1haWw/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

5 years 9 months ago [\#329106](#329106) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Use RegularLabs snippets in email](/forum/27-checkout/901820-use-regularlabs-snippets-in-email#329106 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.4  Hi  Is there any way I can use Snippets from RegularLabs in the emails sent to the customer?   regularlabs.com/extensions/snippets  I tried adding the snippet to the emails, but I don't get any output.  Kind regards Thomas")*

Hi,

Ah my bad, I checked and I can see that the snippet plugin is a system plugin, not a content plugin.
In that case, it won't work in emails as the snippet plugin will only replace the tags at the end of the page processing.
So for that code to work, it would require the plugin to handle the content trigger of Joomla. I think it would be technically possible to add that capability to the plugin as an extra option but you would have to check with RegularLabs.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTgyMC11c2UtcmVndWxhcmxhYnMtc25pcHBldHMtaW4tZW1haWw/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Thrane](/forum/user/31786-thrane "View Thrane's Profile")**
- [![Thrane's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31786-thrane "View Thrane's Profile") Topic Author
- [ Offline](/forum/user/31786-thrane)

Less More

- Posts: 366
- Thank you received: 26
-
-

5 years 9 months ago [\#329196](#329196) by [Thrane](/forum/user/31786-thrane "View Thrane's Profile")  Replied by *[Thrane](/forum/user/31786-thrane "View Thrane's Profile")* on topic *[Use RegularLabs snippets in email](/forum/27-checkout/901820-use-regularlabs-snippets-in-email#329196 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.4  Hi  Is there any way I can use Snippets from RegularLabs in the emails sent to the customer?   regularlabs.com/extensions/snippets  I tried adding the snippet to the emails, but I don't get any output.  Kind regards Thomas")*

NP!

I'll hear RegularLabs on this ![:-)](/media/kunena/emoticons/3.png ":-)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTgyMC11c2UtcmVndWxhcmxhYnMtc25pcHBldHMtaW4tZW1haWw/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Thrane](/forum/user/31786-thrane "View Thrane's Profile")**
- [![Thrane's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31786-thrane "View Thrane's Profile") Topic Author
- [ Offline](/forum/user/31786-thrane)

Less More

- Posts: 366
- Thank you received: 26
-
-

5 years 9 months ago [\#329212](#329212) by [Thrane](/forum/user/31786-thrane "View Thrane's Profile")  Replied by *[Thrane](/forum/user/31786-thrane "View Thrane's Profile")* on topic *[Use RegularLabs snippets in email](/forum/27-checkout/901820-use-regularlabs-snippets-in-email#329212 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.4  Hi  Is there any way I can use Snippets from RegularLabs in the emails sent to the customer?   regularlabs.com/extensions/snippets  I tried adding the snippet to the emails, but I don't get any output.  Kind regards Thomas")*

Hi

I got this reply:

"In that case, it won't work in emails as the snippet plugin will only replace the tags at the end of the page processing."
This is not true.

The Snippets plugin is a system plugin, but it includes the onContentPrepareForm function.
So all HikaShop has to do in not just import the content plugins, but also the system plugins:

JPluginHelper::importPlugin('system');
JPluginHelper::importPlugin('content');

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTgyMC11c2UtcmVndWxhcmxhYnMtc25pcHBldHMtaW4tZW1haWw/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

5 years 9 months ago [\#329222](#329222) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Use RegularLabs snippets in email](/forum/27-checkout/901820-use-regularlabs-snippets-in-email#329222 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.4  Hi  Is there any way I can use Snippets from RegularLabs in the emails sent to the customer?   regularlabs.com/extensions/snippets  I tried adding the snippet to the emails, but I don't get any output.  Kind regards Thomas")*

Hi,

That's great news ! Then it's easy.
Instead of the code: Code:

&lt;?php echo JHTML::_('content.prepare','{snippet handelsbetingelser}'); ?&gt;

use the code: Code:

&lt;?php JPluginHelper::importPlugin('content'); echo JHTML::_('content.prepare','{snippet handelsbetingelser}'); ?&gt;

and it will work.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTgyMC11c2UtcmVndWxhcmxhYnMtc25pcHBldHMtaW4tZW1haWw/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Thrane](/forum/user/31786-thrane "View Thrane's Profile")**
- [![Thrane's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31786-thrane "View Thrane's Profile") Topic Author
- [ Offline](/forum/user/31786-thrane)

Less More

- Posts: 366
- Thank you received: 26
-
-

5 years 9 months ago [\#329247](#329247) by [Thrane](/forum/user/31786-thrane "View Thrane's Profile")  Replied by *[Thrane](/forum/user/31786-thrane "View Thrane's Profile")* on topic *[Use RegularLabs snippets in email](/forum/27-checkout/901820-use-regularlabs-snippets-in-email#329247 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.4  Hi  Is there any way I can use Snippets from RegularLabs in the emails sent to the customer?   regularlabs.com/extensions/snippets  I tried adding the snippet to the emails, but I don't get any output.  Kind regards Thomas")*

I tried in the HTML version, but I don't get the text in the email.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTgyMC11c2UtcmVndWxhcmxhYnMtc25pcHBldHMtaW4tZW1haWw/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

5 years 9 months ago [\#329254](#329254) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Use RegularLabs snippets in email](/forum/27-checkout/901820-use-regularlabs-snippets-in-email#329254 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.4  Hi  Is there any way I can use Snippets from RegularLabs in the emails sent to the customer?   regularlabs.com/extensions/snippets  I tried adding the snippet to the emails, but I don't get any output.  Kind regards Thomas")*

Hi,

Well, I did a test on my end and it works just fine.
I've created a snippet :
[ monosnap.com/file/RSJWz82McILscmHSqHknUGeZnMWsSV](https://monosnap.com/file/RSJWz82McILscmHSqHknUGeZnMWsSV)
and added it in an email:
[ monosnap.com/file/bDEJQfcezAsxm51EwtlTW3HJzUm0Tc](https://monosnap.com/file/bDEJQfcezAsxm51EwtlTW3HJzUm0Tc)
And then I used the "preview" button and I got the snippet replaced:
[ monosnap.com/file/dPpLhurgzgYXDdJJfgPWEGuYr3na4L](https://monosnap.com/file/dPpLhurgzgYXDdJJfgPWEGuYr3na4L)
Just in case I also tried to create an order to make sure that the snippet is replaced in the email received by the customer and it is.
So I don't see why it wouldn't work on your website. Now, I don't know how that extension internal workings and I discovered it 4 days ago...So hard to say why it wouldn't work for you. Would there be a typo in your snippet ? Or it's not published ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTgyMC11c2UtcmVndWxhcmxhYnMtc25pcHBldHMtaW4tZW1haWw/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Thrane](/forum/user/31786-thrane "View Thrane's Profile")**
- [![Thrane's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31786-thrane "View Thrane's Profile") Topic Author
- [ Offline](/forum/user/31786-thrane)

Less More

- Posts: 366
- Thank you received: 26
-
-

5 years 9 months ago [\#329276](#329276) by [Thrane](/forum/user/31786-thrane "View Thrane's Profile")  Replied by *[Thrane](/forum/user/31786-thrane "View Thrane's Profile")* on topic *[Use RegularLabs snippets in email](/forum/27-checkout/901820-use-regularlabs-snippets-in-email#329276 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.4  Hi  Is there any way I can use Snippets from RegularLabs in the emails sent to the customer?   regularlabs.com/extensions/snippets  I tried adding the snippet to the emails, but I don't get any output.  Kind regards Thomas")*

Hi Nicolas

Thanks, not sure why, but I got it to work now ...
I think it's a great way to add terms to the email and have the exact same terms elsewhere.

Have a great day!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTgyMC11c2UtcmVndWxhcmxhYnMtc25pcHBldHMtaW4tZW1haWw/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.065 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
