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

#   Emails Not Sending

##

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

Less More

- Posts: 136
- Thank you received: 1
-
-

15 years 7 months ago [\#11723](#11723) by [jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")  *[Emails Not Sending](/forum/4-how-to/11723-emails-not-sending#11723 "Hi Nicolas,  I've modified the order status notification email to include many details from the product, user and order tables.  Although now when I'm testing it appears that the emails are not sent to the user. I can only assume this is due to something I have done with the coding. I have moved a chunk of php code a few lines lower than it was before. Below is a snippet of my code. If I move the PHP code back to where is was then the $data-&gt;customer-&gt;name; does not return any information. Wondering if you can please shed some light on this?  I would like the emails to be sent to the user, once the status is changed to CONFIRMED.  CODE SNIPPET           customer-&gt;name); ?&gt;   We are pleased to confirm your Beautyscoop purchase.   To redeem your Scoop, please print the voucher below and bring into store with you, or gift it to a friend.           Recipient recipient&#95;name; IF ($gift == ''){ echo &quot;&quot; . $data-&gt;customer-&gt;name; }else{ echo &quot;&quot; . $data-&gt;recipient&#95;name; } ?&gt;    Voucher # order&#95;id; ?&gt;   order&#95;number; $config =&amp; hikashop::config(); if($config-&gt;get('simplified&#95;registration',0)!=2){ $url .= ' ( '.$data-&gt;order&#95;url.' )'; } $data = $class-&gt;get($data-&gt;order&#95;id); $data-&gt;cart = $class-&gt;loadFullOrder($data-&gt;order&#95;id,true,false); $data-&gt;cart-&gt;coupon = null; $price = null; $tax = 0; foreach($data-&gt;cart-&gt;products as $product){ $tax+=round($product-&gt;order&#95;product&#95;tax,2)&#42;$product-&gt;order&#95;product&#95;quantity; } $price-&gt;price&#95;value = $data-&gt;order&#95;full&#95;price-$tax; $price-&gt;price&#95;value&#95;with&#95;tax = $data-&gt;order&#95;full&#95;price; $data-&gt;cart-&gt;full&#95;total = null; $data-&gt;cart-&gt;full&#95;total-&gt;prices = array($price); $data-&gt;cart-&gt;coupon-&gt;discount&#95;value =&amp; $data-&gt;order&#95;discount&#95;price; ?&gt;     Redeem At getFields('frontcomp',$null,'item'); } foreach($data-&gt;cart-&gt;products as $item){ $price = $item-&gt;order&#95;product&#95;price&#42;$item-&gt;order&#95;product&#95;quantity; ?&gt; order&#95;product&#95;name; ?&gt;field&#95;namekey; echo ''.$fieldsClass-&gt;getFieldName($field).': '.$fieldsClass-&gt;show($field,$item-&gt;$namekey).''; } } echo ''; $productClass = hikashop::get('class.product'); foreach($data-&gt;cart-&gt;products as $item){ $productData = $productClass-&gt;get($item-&gt;product&#95;id); echo $productData-&gt;addressline1 .&quot;&quot;; echo $productData-&gt;addressline2 .&quot;&quot;; echo &quot;Phone: &quot;.$productData-&gt;phone .&quot;&quot;; echo $productData-&gt;website; }  ?&gt;    Valid From scoop&#95;start&#95;date; ?&gt;   Valid To scoop&#95;expiry; ?&gt;       END CODE SNIPPET")* was created by *[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")*

Hi Nicolas,

I've modified the **order status notification email** to include many details from the product, user and order tables.

Although now when I'm testing it appears that the emails are not sent to the user. I can only assume this is due to something I have done with the coding. I have moved a chunk of php code a few lines lower than it was before. Below is a snippet of my code. If I move the PHP code back to where is was then the $data-&gt;customer-&gt;name; does not return any information. Wondering if you can please shed some light on this?

I would like the emails to be sent to the user, once the status is changed to CONFIRMED.

CODE SNIPPET

&lt;?php
/**
* @package HikaShop for Joomla!
* @version 1.4.5
* @author hikashop.com
* @copyright (C) 2010 HIKARI SOFTWARE. All rights reserved.
* @license [ www.hikashop.com/commercial\_license.php](http://www.hikashop.com/commercial_license.php)
*/
defined('_JEXEC') or die('Restricted access');
?&gt;
&lt;div style="background-color: #ffffff; font-family: Arial, Helvetica, sans-serif;font-size:12px; color: #000000; width: 100%;"&gt;
&lt;table style="margin: auto;font-family: Arial, Helvetica, sans-serif;font-size:12px;" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="background-color: #cc3232; padding: 5px;"&gt;&lt;img src="images/stories/Newsletters/logo.png" border="0" width="220" height="70" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;br/&gt;
&lt;?php echo JText::sprintf('HI_CUSTOMER',@$data-&gt;customer-&gt;name); ?&gt;
&lt;br/&gt;
&lt;br/&gt;
We are pleased to confirm your Beautyscoop purchase.
&lt;br/&gt;
&lt;br/&gt;
To redeem your Scoop, please print the voucher below and bring into store with you, or gift it to a friend.
&lt;br/&gt;
&lt;br/&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style background="images/stories/Newsletters/voucher_background2.jpg"&gt;
&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td valign="bottom"&gt;&lt;table width="300" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td style="color:#cc3232; font-size:11px; font-weight:bold; text-align: right;"&gt;Recipient&lt;/td&gt;
&lt;td style="color:#555555; font-size:11px; padding-left:10px;"&gt;&lt;?php
//displays different Recipient name, based on whether its a gift or not.
$gift = $data-&gt;recipient_name;
IF ($gift == ''){
echo "" . $data-&gt;customer-&gt;name;
}else{
echo "" . $data-&gt;recipient_name;
}
?&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="color:#cc3232; font-size:11px; font-weight:bold; text-align: right;"&gt;Voucher #&lt;/td&gt;
&lt;td style="color:#555555; font-size:11px; padding-left:10px;"&gt;&lt;?php echo $data-&gt;order_id; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
&lt;?php
$class = hikashop::get('class.order');
$url = $data-&gt;order_number;
$config =&amp; hikashop::config();
if($config-&gt;get('simplified_registration',0)!=2){
$url .= ' ( '.$data-&gt;order_url.' )';
}
$data = $class-&gt;get($data-&gt;order_id);
$data-&gt;cart = $class-&gt;loadFullOrder($data-&gt;order_id,true,false);
$data-&gt;cart-&gt;coupon = null;
$price = null;
$tax = 0;
foreach($data-&gt;cart-&gt;products as $product){
$tax+=round($product-&gt;order_product_tax,2)*$product-&gt;order_product_quantity;
}
$price-&gt;price_value = $data-&gt;order_full_price-$tax;
$price-&gt;price_value_with_tax = $data-&gt;order_full_price;
$data-&gt;cart-&gt;full_total = null;
$data-&gt;cart-&gt;full_total-&gt;prices = array($price);
$data-&gt;cart-&gt;coupon-&gt;discount_value =&amp; $data-&gt;order_discount_price;
?&gt;

&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" style="color:#cc3232; font-size:11px; font-weight:bold; text-align: right;"&gt;Redeem At&lt;/td&gt;
&lt;td style="color:#555555; font-size:11px; padding-left:10px;"&gt;&lt;?php
if(hikashop::level(2)){
$fieldsClass = hikashop::get('class.field');
$null = null;
$itemFields = $fieldsClass-&gt;getFields('frontcomp',$null,'item');
}
foreach($data-&gt;cart-&gt;products as $item){
$price = $item-&gt;order_product_price*$item-&gt;order_product_quantity;
?&gt;
&lt;strong&gt;&lt;?php echo $item-&gt;order_product_name; ?&gt;&lt;/strong&gt;&lt;?php
if(!empty($itemFields)){
foreach($itemFields as $field){
$namekey = $field-&gt;field_namekey;
echo '&lt;p&gt;'.$fieldsClass-&gt;getFieldName($field).': '.$fieldsClass-&gt;show($field,$item-&gt;$namekey).'&lt;/p&gt;';
}
}
echo '&lt;br /&gt;';
$productClass = hikashop::get('class.product');
foreach($data-&gt;cart-&gt;products as $item){
$productData = $productClass-&gt;get($item-&gt;product_id);
echo $productData-&gt;addressline1 ."&lt;br /&gt;";
echo $productData-&gt;addressline2 ."&lt;br /&gt;";
echo "Phone: ".$productData-&gt;phone ."&lt;br /&gt;";
echo $productData-&gt;website;
}

?&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="color:#cc3232; font-size:11px; font-weight:bold; text-align: right;"&gt;Valid From&lt;/td&gt;
&lt;td style="color:#555555; font-size:11px; padding-left:10px;"&gt;&lt;?php echo $productData-&gt;scoop_start_date; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="color:#cc3232; font-size:11px; font-weight:bold; text-align: right;"&gt;Valid To&lt;/td&gt;
&lt;td style="color:#555555; font-size:11px; padding-left:10px;"&gt;&lt;?php echo $productData-&gt;scoop_expiry; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;td style="text-align:right; height:219;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

END CODE SNIPPET

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzExNzIzLWVtYWlscy1ub3Qtc2VuZGluZz90bXBsPW1hcmtkb3du) 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: 86561
- Thank you received: 14307
-
-

15 years 7 months ago [\#11725](#11725) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Emails Not Sending](/forum/4-how-to/11723-emails-not-sending#11725 "Hi Nicolas,  I've modified the order status notification email to include many details from the product, user and order tables.  Although now when I'm testing it appears that the emails are not sent to the user. I can only assume this is due to something I have done with the coding. I have moved a chunk of php code a few lines lower than it was before. Below is a snippet of my code. If I move the PHP code back to where is was then the $data-&gt;customer-&gt;name; does not return any information. Wondering if you can please shed some light on this?  I would like the emails to be sent to the user, once the status is changed to CONFIRMED.  CODE SNIPPET           customer-&gt;name); ?&gt;   We are pleased to confirm your Beautyscoop purchase.   To redeem your Scoop, please print the voucher below and bring into store with you, or gift it to a friend.           Recipient recipient&#95;name; IF ($gift == ''){ echo &quot;&quot; . $data-&gt;customer-&gt;name; }else{ echo &quot;&quot; . $data-&gt;recipient&#95;name; } ?&gt;    Voucher # order&#95;id; ?&gt;   order&#95;number; $config =&amp; hikashop::config(); if($config-&gt;get('simplified&#95;registration',0)!=2){ $url .= ' ( '.$data-&gt;order&#95;url.' )'; } $data = $class-&gt;get($data-&gt;order&#95;id); $data-&gt;cart = $class-&gt;loadFullOrder($data-&gt;order&#95;id,true,false); $data-&gt;cart-&gt;coupon = null; $price = null; $tax = 0; foreach($data-&gt;cart-&gt;products as $product){ $tax+=round($product-&gt;order&#95;product&#95;tax,2)&#42;$product-&gt;order&#95;product&#95;quantity; } $price-&gt;price&#95;value = $data-&gt;order&#95;full&#95;price-$tax; $price-&gt;price&#95;value&#95;with&#95;tax = $data-&gt;order&#95;full&#95;price; $data-&gt;cart-&gt;full&#95;total = null; $data-&gt;cart-&gt;full&#95;total-&gt;prices = array($price); $data-&gt;cart-&gt;coupon-&gt;discount&#95;value =&amp; $data-&gt;order&#95;discount&#95;price; ?&gt;     Redeem At getFields('frontcomp',$null,'item'); } foreach($data-&gt;cart-&gt;products as $item){ $price = $item-&gt;order&#95;product&#95;price&#42;$item-&gt;order&#95;product&#95;quantity; ?&gt; order&#95;product&#95;name; ?&gt;field&#95;namekey; echo ''.$fieldsClass-&gt;getFieldName($field).': '.$fieldsClass-&gt;show($field,$item-&gt;$namekey).''; } } echo ''; $productClass = hikashop::get('class.product'); foreach($data-&gt;cart-&gt;products as $item){ $productData = $productClass-&gt;get($item-&gt;product&#95;id); echo $productData-&gt;addressline1 .&quot;&quot;; echo $productData-&gt;addressline2 .&quot;&quot;; echo &quot;Phone: &quot;.$productData-&gt;phone .&quot;&quot;; echo $productData-&gt;website; }  ?&gt;    Valid From scoop&#95;start&#95;date; ?&gt;   Valid To scoop&#95;expiry; ?&gt;       END CODE SNIPPET")*

On the line:
$data = $class-&gt;get($data-&gt;order_id);

the $data object gets the whole order object from the database. So you need that code to be before something like this:
echo "" . $data-&gt;recipient_name;

However, the subobject customer is in the $data before loading the email. After the line $data = $class-&gt;get($data-&gt;order_id); the customer subobject is not there anymore.
So that's probably why, when you move code around, you don't always get the values of what you want.

Concerning the fact that the email is not sending, do you have some kind of error ?

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

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

Less More

- Posts: 136
- Thank you received: 1
-
-

15 years 7 months ago [\#11728](#11728) by [jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")  Replied by *[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")* on topic *[Re: Emails Not Sending](/forum/4-how-to/11723-emails-not-sending#11728 "Hi Nicolas,  I've modified the order status notification email to include many details from the product, user and order tables.  Although now when I'm testing it appears that the emails are not sent to the user. I can only assume this is due to something I have done with the coding. I have moved a chunk of php code a few lines lower than it was before. Below is a snippet of my code. If I move the PHP code back to where is was then the $data-&gt;customer-&gt;name; does not return any information. Wondering if you can please shed some light on this?  I would like the emails to be sent to the user, once the status is changed to CONFIRMED.  CODE SNIPPET           customer-&gt;name); ?&gt;   We are pleased to confirm your Beautyscoop purchase.   To redeem your Scoop, please print the voucher below and bring into store with you, or gift it to a friend.           Recipient recipient&#95;name; IF ($gift == ''){ echo &quot;&quot; . $data-&gt;customer-&gt;name; }else{ echo &quot;&quot; . $data-&gt;recipient&#95;name; } ?&gt;    Voucher # order&#95;id; ?&gt;   order&#95;number; $config =&amp; hikashop::config(); if($config-&gt;get('simplified&#95;registration',0)!=2){ $url .= ' ( '.$data-&gt;order&#95;url.' )'; } $data = $class-&gt;get($data-&gt;order&#95;id); $data-&gt;cart = $class-&gt;loadFullOrder($data-&gt;order&#95;id,true,false); $data-&gt;cart-&gt;coupon = null; $price = null; $tax = 0; foreach($data-&gt;cart-&gt;products as $product){ $tax+=round($product-&gt;order&#95;product&#95;tax,2)&#42;$product-&gt;order&#95;product&#95;quantity; } $price-&gt;price&#95;value = $data-&gt;order&#95;full&#95;price-$tax; $price-&gt;price&#95;value&#95;with&#95;tax = $data-&gt;order&#95;full&#95;price; $data-&gt;cart-&gt;full&#95;total = null; $data-&gt;cart-&gt;full&#95;total-&gt;prices = array($price); $data-&gt;cart-&gt;coupon-&gt;discount&#95;value =&amp; $data-&gt;order&#95;discount&#95;price; ?&gt;     Redeem At getFields('frontcomp',$null,'item'); } foreach($data-&gt;cart-&gt;products as $item){ $price = $item-&gt;order&#95;product&#95;price&#42;$item-&gt;order&#95;product&#95;quantity; ?&gt; order&#95;product&#95;name; ?&gt;field&#95;namekey; echo ''.$fieldsClass-&gt;getFieldName($field).': '.$fieldsClass-&gt;show($field,$item-&gt;$namekey).''; } } echo ''; $productClass = hikashop::get('class.product'); foreach($data-&gt;cart-&gt;products as $item){ $productData = $productClass-&gt;get($item-&gt;product&#95;id); echo $productData-&gt;addressline1 .&quot;&quot;; echo $productData-&gt;addressline2 .&quot;&quot;; echo &quot;Phone: &quot;.$productData-&gt;phone .&quot;&quot;; echo $productData-&gt;website; }  ?&gt;    Valid From scoop&#95;start&#95;date; ?&gt;   Valid To scoop&#95;expiry; ?&gt;       END CODE SNIPPET")*

But that's confusing me because the php code is exactly the same as the original email it's just moved a few lines down. Because of the fact that the user name wasn't displaying anywhere underneath that chunk of code.

I searched for $data = $class-&gt;get($data-&gt;order_id); in the original notification - before I made any changes and I don't see the subobject you're referring to.

Can't see any errors either.

This is the last piece of work before my site goes live! I'm incredibly happy with this product and support.

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

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

Less More

- Posts: 136
- Thank you received: 1
-
-

15 years 7 months ago [\#11730](#11730) by [jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")  Replied by *[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")* on topic *[Re: Emails Not Sending](/forum/4-how-to/11723-emails-not-sending#11730 "Hi Nicolas,  I've modified the order status notification email to include many details from the product, user and order tables.  Although now when I'm testing it appears that the emails are not sent to the user. I can only assume this is due to something I have done with the coding. I have moved a chunk of php code a few lines lower than it was before. Below is a snippet of my code. If I move the PHP code back to where is was then the $data-&gt;customer-&gt;name; does not return any information. Wondering if you can please shed some light on this?  I would like the emails to be sent to the user, once the status is changed to CONFIRMED.  CODE SNIPPET           customer-&gt;name); ?&gt;   We are pleased to confirm your Beautyscoop purchase.   To redeem your Scoop, please print the voucher below and bring into store with you, or gift it to a friend.           Recipient recipient&#95;name; IF ($gift == ''){ echo &quot;&quot; . $data-&gt;customer-&gt;name; }else{ echo &quot;&quot; . $data-&gt;recipient&#95;name; } ?&gt;    Voucher # order&#95;id; ?&gt;   order&#95;number; $config =&amp; hikashop::config(); if($config-&gt;get('simplified&#95;registration',0)!=2){ $url .= ' ( '.$data-&gt;order&#95;url.' )'; } $data = $class-&gt;get($data-&gt;order&#95;id); $data-&gt;cart = $class-&gt;loadFullOrder($data-&gt;order&#95;id,true,false); $data-&gt;cart-&gt;coupon = null; $price = null; $tax = 0; foreach($data-&gt;cart-&gt;products as $product){ $tax+=round($product-&gt;order&#95;product&#95;tax,2)&#42;$product-&gt;order&#95;product&#95;quantity; } $price-&gt;price&#95;value = $data-&gt;order&#95;full&#95;price-$tax; $price-&gt;price&#95;value&#95;with&#95;tax = $data-&gt;order&#95;full&#95;price; $data-&gt;cart-&gt;full&#95;total = null; $data-&gt;cart-&gt;full&#95;total-&gt;prices = array($price); $data-&gt;cart-&gt;coupon-&gt;discount&#95;value =&amp; $data-&gt;order&#95;discount&#95;price; ?&gt;     Redeem At getFields('frontcomp',$null,'item'); } foreach($data-&gt;cart-&gt;products as $item){ $price = $item-&gt;order&#95;product&#95;price&#42;$item-&gt;order&#95;product&#95;quantity; ?&gt; order&#95;product&#95;name; ?&gt;field&#95;namekey; echo ''.$fieldsClass-&gt;getFieldName($field).': '.$fieldsClass-&gt;show($field,$item-&gt;$namekey).''; } } echo ''; $productClass = hikashop::get('class.product'); foreach($data-&gt;cart-&gt;products as $item){ $productData = $productClass-&gt;get($item-&gt;product&#95;id); echo $productData-&gt;addressline1 .&quot;&quot;; echo $productData-&gt;addressline2 .&quot;&quot;; echo &quot;Phone: &quot;.$productData-&gt;phone .&quot;&quot;; echo $productData-&gt;website; }  ?&gt;    Valid From scoop&#95;start&#95;date; ?&gt;   Valid To scoop&#95;expiry; ?&gt;       END CODE SNIPPET")*

Hi Nicolas,

Where can I see if there are any errors relating to the emails not being delivered?

Thank you,
jac

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzExNzIzLWVtYWlscy1ub3Qtc2VuZGluZz90bXBsPW1hcmtkb3du) 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: 86561
- Thank you received: 14307
-
-

15 years 7 months ago [\#11742](#11742) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Emails Not Sending](/forum/4-how-to/11723-emails-not-sending#11742 "Hi Nicolas,  I've modified the order status notification email to include many details from the product, user and order tables.  Although now when I'm testing it appears that the emails are not sent to the user. I can only assume this is due to something I have done with the coding. I have moved a chunk of php code a few lines lower than it was before. Below is a snippet of my code. If I move the PHP code back to where is was then the $data-&gt;customer-&gt;name; does not return any information. Wondering if you can please shed some light on this?  I would like the emails to be sent to the user, once the status is changed to CONFIRMED.  CODE SNIPPET           customer-&gt;name); ?&gt;   We are pleased to confirm your Beautyscoop purchase.   To redeem your Scoop, please print the voucher below and bring into store with you, or gift it to a friend.           Recipient recipient&#95;name; IF ($gift == ''){ echo &quot;&quot; . $data-&gt;customer-&gt;name; }else{ echo &quot;&quot; . $data-&gt;recipient&#95;name; } ?&gt;    Voucher # order&#95;id; ?&gt;   order&#95;number; $config =&amp; hikashop::config(); if($config-&gt;get('simplified&#95;registration',0)!=2){ $url .= ' ( '.$data-&gt;order&#95;url.' )'; } $data = $class-&gt;get($data-&gt;order&#95;id); $data-&gt;cart = $class-&gt;loadFullOrder($data-&gt;order&#95;id,true,false); $data-&gt;cart-&gt;coupon = null; $price = null; $tax = 0; foreach($data-&gt;cart-&gt;products as $product){ $tax+=round($product-&gt;order&#95;product&#95;tax,2)&#42;$product-&gt;order&#95;product&#95;quantity; } $price-&gt;price&#95;value = $data-&gt;order&#95;full&#95;price-$tax; $price-&gt;price&#95;value&#95;with&#95;tax = $data-&gt;order&#95;full&#95;price; $data-&gt;cart-&gt;full&#95;total = null; $data-&gt;cart-&gt;full&#95;total-&gt;prices = array($price); $data-&gt;cart-&gt;coupon-&gt;discount&#95;value =&amp; $data-&gt;order&#95;discount&#95;price; ?&gt;     Redeem At getFields('frontcomp',$null,'item'); } foreach($data-&gt;cart-&gt;products as $item){ $price = $item-&gt;order&#95;product&#95;price&#42;$item-&gt;order&#95;product&#95;quantity; ?&gt; order&#95;product&#95;name; ?&gt;field&#95;namekey; echo ''.$fieldsClass-&gt;getFieldName($field).': '.$fieldsClass-&gt;show($field,$item-&gt;$namekey).''; } } echo ''; $productClass = hikashop::get('class.product'); foreach($data-&gt;cart-&gt;products as $item){ $productData = $productClass-&gt;get($item-&gt;product&#95;id); echo $productData-&gt;addressline1 .&quot;&quot;; echo $productData-&gt;addressline2 .&quot;&quot;; echo &quot;Phone: &quot;.$productData-&gt;phone .&quot;&quot;; echo $productData-&gt;website; }  ?&gt;    Valid From scoop&#95;start&#95;date; ?&gt;   Valid To scoop&#95;expiry; ?&gt;       END CODE SNIPPET")*

You can try to change the status of an order in your back end and activate the notification. If you have an error it should be displayed in the popup.

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

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

Less More

- Posts: 136
- Thank you received: 1
-
-

15 years 7 months ago [\#11752](#11752) by [jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")  Replied by *[jacorr27](/forum/user/626-jacorr27 "View jacorr27's Profile")* on topic *[Re: Emails Not Sending](/forum/4-how-to/11723-emails-not-sending#11752 "Hi Nicolas,  I've modified the order status notification email to include many details from the product, user and order tables.  Although now when I'm testing it appears that the emails are not sent to the user. I can only assume this is due to something I have done with the coding. I have moved a chunk of php code a few lines lower than it was before. Below is a snippet of my code. If I move the PHP code back to where is was then the $data-&gt;customer-&gt;name; does not return any information. Wondering if you can please shed some light on this?  I would like the emails to be sent to the user, once the status is changed to CONFIRMED.  CODE SNIPPET           customer-&gt;name); ?&gt;   We are pleased to confirm your Beautyscoop purchase.   To redeem your Scoop, please print the voucher below and bring into store with you, or gift it to a friend.           Recipient recipient&#95;name; IF ($gift == ''){ echo &quot;&quot; . $data-&gt;customer-&gt;name; }else{ echo &quot;&quot; . $data-&gt;recipient&#95;name; } ?&gt;    Voucher # order&#95;id; ?&gt;   order&#95;number; $config =&amp; hikashop::config(); if($config-&gt;get('simplified&#95;registration',0)!=2){ $url .= ' ( '.$data-&gt;order&#95;url.' )'; } $data = $class-&gt;get($data-&gt;order&#95;id); $data-&gt;cart = $class-&gt;loadFullOrder($data-&gt;order&#95;id,true,false); $data-&gt;cart-&gt;coupon = null; $price = null; $tax = 0; foreach($data-&gt;cart-&gt;products as $product){ $tax+=round($product-&gt;order&#95;product&#95;tax,2)&#42;$product-&gt;order&#95;product&#95;quantity; } $price-&gt;price&#95;value = $data-&gt;order&#95;full&#95;price-$tax; $price-&gt;price&#95;value&#95;with&#95;tax = $data-&gt;order&#95;full&#95;price; $data-&gt;cart-&gt;full&#95;total = null; $data-&gt;cart-&gt;full&#95;total-&gt;prices = array($price); $data-&gt;cart-&gt;coupon-&gt;discount&#95;value =&amp; $data-&gt;order&#95;discount&#95;price; ?&gt;     Redeem At getFields('frontcomp',$null,'item'); } foreach($data-&gt;cart-&gt;products as $item){ $price = $item-&gt;order&#95;product&#95;price&#42;$item-&gt;order&#95;product&#95;quantity; ?&gt; order&#95;product&#95;name; ?&gt;field&#95;namekey; echo ''.$fieldsClass-&gt;getFieldName($field).': '.$fieldsClass-&gt;show($field,$item-&gt;$namekey).''; } } echo ''; $productClass = hikashop::get('class.product'); foreach($data-&gt;cart-&gt;products as $item){ $productData = $productClass-&gt;get($item-&gt;product&#95;id); echo $productData-&gt;addressline1 .&quot;&quot;; echo $productData-&gt;addressline2 .&quot;&quot;; echo &quot;Phone: &quot;.$productData-&gt;phone .&quot;&quot;; echo $productData-&gt;website; }  ?&gt;    Valid From scoop&#95;start&#95;date; ?&gt;   Valid To scoop&#95;expiry; ?&gt;       END CODE SNIPPET")*

Hi Nicolas,

I just replied to another thread relating to the same problem.

I have been testing through the status change, and receiving no errors.

Jac

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzExNzIzLWVtYWlscy1ub3Qtc2VuZGluZz90bXBsPW1hcmtkb3du) 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.070 seconds

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