Still no admin mail

wvd_vegt - October 18, 2007 - 14:08
Project:SaleMail
Version:5.x-3.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

These are the steps i took (on Drupal 5.2):

1) followed the install (and patch instructions one of the testing servers),
2) removed the two & signs that gave php errors in the salemail.module,
3) enabled the salemail module,
4) created a default admin notification mail of the correct type.
5) used the cod module for payment.

but still do not get a admin mail. Any suggestions of how to debug this situation?

Btw i do not see a combobox for the notification mail under /?q=admin/ecsettings/store (Email Notificatons).

The normal mail to the customer gets sent without problems.

I noticed that the patch to the cart won't send a mail if the price is $0,- or less (as it has a return statement in that case just before the new code).

#1

wvd_vegt - November 16, 2007 - 11:25

If you replace the code that has to be inserted to

//This bit of code taken from EC4 to allow mails to be sent on order submission
foreach (module_implements('checkoutapi') as $module) {
$function = "{$module}_checkoutapi";
function_exists($function) && $function($txn, 'post_process');
}
//End code insertion

It works properly. Somehow the salemail does not appear in the $txn->review_screens of the original code:

foreach ($txn->review_screens as $module) {
..
}

Also inserting it before the block (in cart.module)

// If the transaction is done, tell them and send them home
if ($txn->gross <= 0) {
store_send_invoice_email($txn->txnid);
drupal_set_message(t('Your order has been submitted.'));
return '';
}

the admin will always receive a notification, even when free items are ordered.

Forgot to mention above is for the ecommerce-5.x-3.x branch of eCommerce.

#2

wvd_vegt - November 16, 2007 - 13:52

Hi,

Got the solution for the last issue, the missing mailid.

Solution is to add an installation file called 'salemail.install' containing the following code:

<?php
// $Id: salemail.install,v 1.20.2.1.2.12.2.11 2007/07/27 13:10:56 gordon Exp $

require_once(drupal_get_path('module', 'store') . '/store.deps.inc');

/**
* E-Commerce salemail.module schema
*/
function salemail_install() {

 
// builds initial mail into the system
 
require_once(drupal_get_path('module', 'ec_mail') . '/ec_mail.module');
 
 
// include the install's own module so that the constants are defined.
 
require_once(drupal_get_path('module', 'salemail') .'/salemail.module');
 
ec_mail_reset_to_defaults(ECMAIL_TYPE_ADMIN_SALE_NOTIFY, 'salemail');

 
drupal_set_message(t('SALEMAIL module installed successfully.'));
}
?>

This code might throw some warnings about array_merge() which i think are caused by a harmless bug in e-Commerce:ec_mail.module (it does not check if the thing it excepts is an array indeed).

#3

smoothstr@drupal.org - November 16, 2007 - 21:58

Thanks again Wim. I thought I'd included an install file when I originally uploaded, but yes, the install file IS missing and it's crucial otherwise you won't have the mail visible.

Probably to do with me actually having developed this on Drupal 4.7.

(For others looking at SaleMail - yes, it does work on 4.7. Currently use the 5.3 download.

Will be fixed over the weekend.

#4

smoothstr@drupal.org - November 16, 2007 - 22:00

Regarding no mail on $0.

Yes, I guess it does make sense to mail if a product is free. Will check and change if it's not guarding against something else.

#5

acdtrp - December 23, 2007 - 09:52

I still get just an empty message when a sale is made even that I have created a text of that mail type and did everything as told above. I have created and uploaded the salemail.install file but I don't think it gets executed - I don't see the "SALEMAIL module installed successfully." but only the "The configuration options have been saved." Any ideas?

#6

Phillip Mc - January 10, 2008 - 13:31
Category:support request» bug report

I had the same problems as others, which is a pity..this could be a very useful module.

I wasn't able to work out why it wasn't working, but, I did find a patch for store.module and cart.module (for eCommerce 5.x-3.x here:

http://drupal.org/node/193086

That patch sends an admin email on each sale automatically. It also allows you to switch single order notices on/off in the store settings page, which is useful.

hope that's of use for others.

#7

mdowsett - December 9, 2008 - 19:55

adding this salemail.install file didn't help me.

I didn't get the confirumation message that this module was installed successfully nor is there a 'Sale Notification' mail in the ec_mail lists either.

#8

mdowsett - December 10, 2008 - 15:15

I managed to get the ecommerce patch working...I'd go that route if you need this feature over using salemail

 
 

Drupal is a registered trademark of Dries Buytaert.