AC suddenly sending template e-mail to customer

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

AC suddenly sending template e-mail to customer

Post by Brewhaus » Wed Mar 23, 2016 11:29 am

A customer contacted me today to tell me that, beginning yesterday, they have suddenly been receiving the Gift Certificate Validated e-mail. None of the information is filled out (ie. no customer name, no serial number). We have made no updates to our server or AC, and only one customer has reported this. This customer has never ordered a gift certificate, and has not purchased from us since December, so we cannot figure out what may have prompted this.

I tried changing the e-mail address that AC uses to send e-mails, thinking that if a spammer somehow got access to one of our e-mail addresses (and for some unknown reason had that particular e-mail), that the customer would continue to receive the e-mails from the old address. The customer did continue to receive the e-mail, but it came from the newly created e-mail address. That means that it must be getting sent by the AC software.

That leaves me two questions:
How do we stop it?
What would cause this in the first place??

Is there anywhere in AC that we can see the e-mails sent? This would help us to confirm that no other unwarranted e-mails are going out.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: AC suddenly sending template e-mail to customer

Post by Katie » Wed Mar 23, 2016 12:47 pm

Hi,

Can you look at the email template settings? It should be named something like "Gift Certificate Validated". What values to you have for the To, From, CC, and BCC fields? Now, look at the event triggers using the second tab. Which trigger is selected?

Can you also look at the Manage > Gift Certificates page and see if there are actual gift certificates being activated?

Thanks,
Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: AC suddenly sending template e-mail to customer

Post by Brewhaus » Wed Mar 23, 2016 12:55 pm

Hi Katie,

To: customer,warehouse@brewhaus.com
From: merchant
BCC: empty

Triggers: Pending gift certificate validated

I checked, and there has not been a gift certificate created since 12/28/2015.

Thanks for your help!

Rick
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: AC suddenly sending template e-mail to customer

Post by Katie » Wed Mar 23, 2016 1:01 pm

Hi Rick,

I have never seen AbleCommerce send random emails before. It just doesn't make sense. Are you 100% sure that this email is actually being sent from AbleCommerce? One thing you can do is create a test gift certificate, then validate it with a paid order. The email should be sent to you (customer) and the warehouse@ address. Then you can carefully compare this email with the other ones you are receiving. Be sure to check the email header info as well.

Please keep me updated. This is very strange...

Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: AC suddenly sending template e-mail to customer

Post by Brewhaus » Wed Mar 23, 2016 1:23 pm

I agree- I do not know why AC would do this. The reason that I feel it must be AC is that I created a new e-mail address, and then set AC up to use this e-mail address by default. The e-mail address is not used for anything else. When the customer received the next 'Gift Certificate Validated' e-mail it came from the new e-mail address. That told me that it could not be someone spoofing the address.

I am completely lost on this. Let's wait and see if it happens again, and take it from there. Hopefully it got whatever caused this out of its system. :lol:
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: AC suddenly sending template e-mail to customer

Post by Brewhaus » Thu Mar 24, 2016 6:05 am

The template sent four more times between last night and this morning. I had changed the e-mail address on the customer's account to one of my e-mail addresses so that if the e-mail was sent to the account again, that it would likely go to 'my' e-mail address. It appears that worked, and that it is still sending the template.

Things to note:
After receiving a copy that was sent at 8:40pm I decided to restart SQL and IIS. I received the next copy at 9:47pm.
Two more were sent overnight, at 1:40am and 7:40am.
Other than the copy sent when I restarted SQL and IIS, the e-mails are going out at 40 minutes after the hour. Spacing was 5 hours and then 6 hours apart.

I have deselected the trigger, so there are now no triggers set for the template, and will wait to see if it is sent again. I will confirm back with what happens. If removing the trigger works then I will try setting up a new version of the e-mail and selecting the trigger to see if that works.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: AC suddenly sending template e-mail to customer

Post by Katie » Thu Mar 24, 2016 6:19 am

Hi Rick,

Thanks for keeping us updated. BTW, you win for having the most unusual issue I've seen in a very long time :)

Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: AC suddenly sending template e-mail to customer

Post by Brewhaus » Thu Mar 24, 2016 6:29 am

Yay me! :lol:
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: AC suddenly sending template e-mail to customer

Post by Brewhaus » Thu Mar 24, 2016 8:04 am

Another customer has reported receiving the same template e-mail several times. They forwarded a copy, and the time that it was sent was 3:40pm yesterday (again with the XX:40).

I am waiting to hear if they have received a copy since we turned off the trigger...
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: AC suddenly sending template e-mail to customer

Post by Brewhaus » Thu Mar 24, 2016 10:32 am

Unfortunately, removing the trigger did not help. We received a copy at 1:40pm. The other customer that had told us they were receiving it received one at 2:40pm (but they are an hour ahead of us), and another customer e-mailed to say that they are receiving it, as well. They have received it 21 times now, the last being at 12:40pm (he is an hour behind us).

I have deleted the template entirely, and created a new copy, with no triggers. Hopefully that helps.

So you have any thoughts? I have attached the template code below, but it has not changed, so I cannot imagine something in there could cause this.

Code: Select all

<p>Gift Certificate Validated for Order Number $order.OrderNumber&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<table style="width: 510px;" border="2" cellspacing="1" cellpadding="1" align="center">
<tbody>
<tr>
<td style="text-align: center;">
<p><img src="http://www.brewhaus.com/assets/Gift-Certificate.jpg" alt="" /></p>
<p>&nbsp;</p>
<p>Value: $giftcertificate.Balance.ToString("c")&nbsp;&nbsp;&nbsp; Serial Number: $giftcertificate.SerialNumber</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table class="Email">
<tbody>
<tr>
<td class="Email" colspan="2">
<p><strong>Greetings $order.BillToFirstName $order.BillToLastName !</strong></p>
<p>The Gift Certificate <strong>$giftcertificate.Name </strong>is activated. You can view or print the details of your gift certificate using the information below.</p>
<p><strong>$giftcertificate.Name:</strong> <a href="${store.StoreUrl}Members/MyGiftCertificate.aspx?GiftCertificateId=$giftcertificate.GiftCertificateId">View Online </a></p>
<p>If you would like to check the status of your order, manage addresses, update your email, or customize many other options, please visit your personal <a href="${store.StoreUrl}Members/MyAccount.aspx">My Account</a> page.</p>
<p>Thank you for shopping with us.<br />$store.Name</p>
</td>
</tr>
</tbody>
</table>
<table class="Email">
<tbody>
<tr><th class="Email">Order Summary</th></tr>
</tbody>
</table>
<table class="Email">
<tbody>
<tr>
<td class="Email">
<div align="right"><strong>Email Address:</strong></div>
</td>
<td class="Email">${order.BillToEmail}</td>
</tr>
<tr>
<td class="Email" width="140">
<div align="right"><strong>Order Number:</strong></div>
</td>
<td class="Email" width="500">
<p>$order.OrderNumber</p>
</td>
</tr>
<tr>
<td class="Email">
<div align="right"><strong>Ordered on:</strong></div>
</td>
<td class="Email">$order.OrderDate.ToString("G")</td>
</tr>
<tr>
<td class="Email">
<div align="right"><strong>Ordered by:</strong></div>
</td>
<td class="Email">$order.BillToFirstName $order.BillToLastName</td>
</tr>
<tr>
<td>
<div align="right"><strong>Order Total:</strong></div>
</td>
<td>$order.Items.TotalPriceById().ToString("c")</td>
</tr>
<tr>
<td class="Email">
<div align="right"><strong>Order Status:</strong></div>
</td>
<td class="Email"><a href="${store.StoreUrl}Members/MyOrder.aspx?OrderNumber=$order.OrderNumber&OrderId=$order.OrderId">View Online</a></td>
</tr>
</tbody>
</table>
<table class="Email">
<tbody>
<tr valign="top">
<td class="Email" width="50%"><strong>Billing Address:</strong>
<div style="padding-left: 30px;">$order.FormatAddress(true)</div>
</td>
<td class="Email" width="50%"><strong>Payment Method:</strong>
<div style="padding-left: 30px;">#foreach($payment in $payments) $payment.PaymentMethodName<br />$payment.ReferenceNumber<br /> #end</div>
</td>
</tr>
</tbody>
</table>
#set ($shipNo = 1) #foreach($shipment in $order.Shipments) #beforeall
<table class="Email">
<tbody>
<tr><th class="Email">Shipment Information</th></tr>
</tbody>
</table>
#each#foreach($orderItem in $order.Items.FilterByShipmentAndSort($shipment.OrderShipmentId)) #beforeall#each #if ((($orderItem.OrderItemType == "Product") || ($orderItem.OrderItemType == "Discount") || ($orderItem.OrderItemType == "Coupon") || ($orderItem.OrderItemType == "GiftWrap")) && !$orderItem.IsHidden)#end #end
<table class="Email">
<tbody>
<tr>
<td class="Email" style="text-align: center;" colspan="4"><strong><span style="text-decoration: underline;">Shipment $shipNo of $order.Shipments.Count</span></strong> #set ($shipNo = $shipNo + 1)</td>
</tr>
<tr>
<td class="Email" style="text-align: center;" colspan="4">
<table style="width: 100%;">
<tbody>
<tr>
<td class="Email" valign="top"><strong>Ship From:</strong>
<div style="padding-left: 30px;">$shipment.FormatFromAddress(true)</div>
</td>
<td class="Email" valign="top"><strong>Ship To:</strong>
<div style="padding-left: 30px;">$shipment.FormatToAddress(true) #if ($shipment.ShipMessage.Length > 0) <br /><strong>Message:</strong>$shipment.ShipMessage #end</div>
</td>
<td class="Email" valign="top"><strong>Shipment Method:</strong>
<div style="padding-left: 30px;">$shipment.ShipMethodName</div>
<div style="padding-left: 30px;">&nbsp;</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="text-align: center; background: #cccccc;"><strong>SKU</strong></td>
<td style="text-align: center; background: #cccccc;"><strong>Description</strong></td>
<td style="text-align: center; background: #cccccc;"><strong>Quantity</strong></td>
<td style="text-align: center; background: #cccccc;"><strong>Price</strong></td>
</tr>
<tr class="Email">
<td class="Email" style="text-align: center;">#if (($orderItem.OrderItemType == "Product")) $orderItem.Sku #elseif (($orderItem.OrderItemType == "Discount")) DISCOUNT #elseif (($orderItem.OrderItemType == "Coupon")) COUPON #elseif (($orderItem.OrderItemType == "GiftWrap")) GIFTWRAP #end</td>
<td class="Email">$orderItem.Name #if ($orderItem.VariantName.Length > 0) ($orderItem.VariantName) #end #foreach($orderItemInput in $orderItem.Inputs) #if (!$orderItemInput.IsMerchantField) <br /><strong>$orderItemInput.Name:</strong> $orderItemInput.InputValue #end #end #if ($orderItem.WrapStyle) <br />Gift-Wrap: $orderItem.WrapStyle.Name #end</td>
<td class="Email" style="text-align: center;">$orderItem.Quantity</td>
<td class="Email" style="text-align: right;">$orderItem.ExtendedPrice.ToString("c")</td>
</tr>
<tr class="Email">
<td colspan="4">&nbsp;</td>
</tr>
</tbody>
</table>
#end <!-- Output Non-Shipping Items -->#foreach($orderItem in $order.Items.FilterByShipmentAndSort()) #beforeall
<table class="Email">
<tbody>
<tr><th class="Email">Non-Shipping Items</th></tr>
</tbody>
</table>
#each #if ((($orderItem.OrderItemType == "Product") || ($orderItem.OrderItemType == "Coupon") || ($orderItem.OrderItemType == "Discount")) && !$orderItem.IsHidden)#end #afterall
<table class="Email">
<tbody>
<tr>
<td style="text-align: center; background: #cccccc;"><strong>SKU</strong></td>
<td style="text-align: center; background: #cccccc;"><strong>Name</strong></td>
<td style="text-align: center; background: #cccccc;"><strong>Price</strong></td>
<td style="text-align: center; background: #cccccc;"><strong>Quantity</strong></td>
<td style="text-align: center; background: #cccccc;"><strong>Total</strong></td>
</tr>
<tr>
<td class="Email" style="text-align: center;">#if (($orderItem.OrderItemType == "Product")) $orderItem.Sku #elseif (($orderItem.OrderItemType == "Discount")) DISCOUNT #elseif (($orderItem.OrderItemType == "Coupon")) COUPON #end</td>
<td class="Email">$orderItem.Name #if ($orderItem.VariantName.Length > 0) ($orderItem.VariantName) #end #foreach($orderItemInput in $orderItem.Inputs) #if (!$orderItemInput.IsMerchantField) <br /><strong>$orderItemInput.Name:</strong> $orderItemInput.InputValue #end #end</td>
<td class="Email" style="text-align: right;">$orderItem.Price.ToString("c")</td>
<td class="Email" style="text-align: center;">$orderItem.Quantity</td>
<td class="Email" style="text-align: right;">$orderItem.ExtendedPrice.ToString("c")</td>
</tr>
</tbody>
</table>
#end
<table class="Email">
<tbody>
<tr><th class="Email">Order Totals</th></tr>
</tbody>
</table>
<table class="Email">
<tbody>
<tr>
<td style="text-align: right; background: #cccccc;" width="40%"><strong>Subtotal:</strong></td>
<td class="Email" style="text-align: right;" width="15%">$order.Items.TotalPriceById(0).ToString("c")</td>
<td rowspan="5" width="55%">
<p align="center"><strong>Thanks again for shopping with us!</strong></p>
<p align="center"><a href="${store.StoreUrl}"><strong>$store.Name</strong></a></p>
</td>
</tr>
<tr>
<td style="text-align: right; background: #cccccc;" width="40%"><strong>Tax:</strong></td>
<td class="Email" style="text-align: right;" width="15%">$order.Items.TotalPriceById(3).ToString("c")</td>
</tr>
<tr>
<td style="text-align: right; background: #cccccc;" width="40%"><strong>Shipping and Handling:</strong></td>
<td class="Email" style="text-align: right;" width="15%">$order.Items.TotalPriceById(1, 2).ToString("c")</td>
</tr>
<tr>
<td style="text-align: right; background: #cccccc;" width="40%"><strong>Discounts:</strong></td>
<td class="Email" style="text-align: right;" width="15%">$order.Items.TotalPriceById(4).ToString("c")</td>
</tr>
<tr>
<td style="text-align: right; background: #cccccc;" width="40%"><strong>Coupons:</strong></td>
<td class="Email" style="text-align: right;" width="15%">$order.Items.TotalPriceById(5).ToString("c")</td>
</tr>
<tr>
<td style="text-align: right; background: #cccccc;" width="30%"><strong>Total:</strong></td>
<td class="Email" style="text-align: right;" width="15%">$order.Items.TotalPriceById().ToString("c")</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 436
Joined: Tue May 07, 2013 1:59 pm

Re: AC suddenly sending template e-mail to customer

Post by jguengerich » Fri Mar 25, 2016 3:42 am

It sounds like the maintenance routine is causing them to be sent. By default, it runs every 6 hours. Do you have source code? There is a MaintenanceWorker.cs in \CommerceBuilder\Services that has the code that runs. You might have to follow the "code trail" starting there to see if any customizations you have done are causing something "extra" to happen.
Jay

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: AC suddenly sending template e-mail to customer

Post by Brewhaus » Fri Mar 25, 2016 4:06 am

I may be able to pull the information from the file that you mentioned, but it appears to have stopped now that I deleted the template and replaced it with a new version.

What is so odd is that this came out of nowhere. We have not made changes to any files in a while. If we had, then I would be able to say that it was a result of some change that we made. It is also strange that it picked out a few customers to send the e-mail to. Very odd.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: AC suddenly sending template e-mail to customer

Post by Katie » Fri Mar 25, 2016 6:37 am

I asked a developer to look through the code, and we don't send any emails for gift certificates in maintenance etc. It could be some glitch with the email server, but we can't really say for sure.

We send gift certificate validated email in these three cases:
- when certificate is purchased and activated during checkout or order fulfillment,
- when recurring order service generates an order for gift certificate product,
- or when an admin manually activates the certificate.

Without the trigger being activated, I don't think it could send this email.

Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: AC suddenly sending template e-mail to customer

Post by Brewhaus » Fri Mar 25, 2016 7:09 am

I realize that the system definitely should not have been sending the e-mails, but it was, and on a 6-hour basis. The e-mails were sent to customers who had never purchased a gift certificate, and when I created a new e-mail address in our e-mail server, and replaced the old e-mail address in AC with the new one, the e-mails went out using the new e-mail address. These things definitely indicate that AC was sending the e-mails. Even after removing all triggers the e-mail continued to send. The only thing that stopped it was removing the template entirely.

This was also isolated to just the one website, but our two sites use the same server, same e-mail server, same customizations, and same version of AC, so that makes it even more strange.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: AC suddenly sending template e-mail to customer

Post by mazhar » Wed Mar 30, 2016 3:52 am

Which version of ablecommerce that website is running?

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: AC suddenly sending template e-mail to customer

Post by Brewhaus » Wed Mar 30, 2016 3:57 am

Gold R9
Version 7.0.88.7345
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: AC suddenly sending template e-mail to customer

Post by mazhar » Wed Mar 30, 2016 4:25 am

Do you have anything customization which maybe related to this? Any custom recurring event implemented for something? By default six hours is maintenance interval but we don't send Emails during maintenance. Is it possible to see what was the order against which customer received Emails? Maybe inspecting order contents provide any clue.

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: AC suddenly sending template e-mail to customer

Post by Brewhaus » Wed Mar 30, 2016 4:48 am

There were at least three customers that received the e-mail, and they received it every six hours. None of the customers had ever purchased a gift certificate, and the e-mail that they received did not list an order number, gift certificate serial number, or name. It was just the basic template that they received. Even with all triggers removed the e-mail kept being sent. As soon as we deleted the template and replaced it, the e-mails stopped sending.

We have several customizations on our site, but none that have been added since the end of last year.

Rick
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: AC suddenly sending template e-mail to customer

Post by mazhar » Wed Mar 30, 2016 11:51 pm

After deleting the templates have you noticed any errors in error log? If there was any potential code sending those mails it could be failing and dumping errors in log. If you found any related error entry then this could be helpful and may provide hint about code location.

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: AC suddenly sending template e-mail to customer

Post by Brewhaus » Thu Mar 31, 2016 3:26 am

No, we have not seen any errors in the error log.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

Post Reply