Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Mail Manager


npn2531

Recommended Posts

Dealing with the Tell a Friend page when I test it out the product image does not show at all in the email.

 

All I see with the image is a box with a red X right inside. I have played around with it trying to get it to spit out any image at all and for whatever reason it is being real stubborn.

 

Any ideas whats wrong?

Link to comment
Share on other sites

I think you have located an error in my coding.

includes/mail_manager/tell_a_friend.php is looking for the variable $product_info['products_image_xl']. That variable is defined in the query on catalog/tell_a_friend.php.

 

If you do not have the article manager or some other contribution installed, like I do, then the standard query on catalog/tell_a_friend.php does not have the image defined.

 

To fix, locate this query near the top of catalog/tell_a_friend.php

if (isset($HTTP_GET_VARS['products_id'])) {
   $product_info_query = tep_db_query("select pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
   if (tep_db_num_rows($product_info_query)) {
  $valid_product = true;

 

change to :

if (isset($HTTP_GET_VARS['products_id'])) {
   $product_info_query = tep_db_query("select p.products_image_xl, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
   if (tep_db_num_rows($product_info_query)) {
  $valid_product = true;

 

note that you may need to use products_image instead of products_image_xl . Check your products table in the database. If this fixes it, post it back here and please add the correction to the mail manager contribution, or let me know to add it.

 

Thanks

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

We checked our code and can confirm that we already have the code below:

 

 if (isset($HTTP_GET_VARS['products_id'])) {
   $product_info_query = tep_db_query("select p.products_image, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
   if (tep_db_num_rows($product_info_query)) {
  $valid_product = true;

 

The only difference from our code and yours is we use the "products_image" label so we made no changes to the code and this must not be where the problem is coming from.

Link to comment
Share on other sites

Since you are using p.products_image in catalog/tell_a_friend.php be sure you change p.products_image_xl in includes/modules/mail_manager/tell_a_friend.php to p.products_image.

Edited by npn2531

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

The image now shows what I had to do was find this code:

 

$product_image = tep_image($image_urlfix.DIR_WS_IMAGES . $product_info['products_image_med'], $product_info['products_name'], '', '', '');

 

and change it to:

 

$product_image = tep_image($image_urlfix.DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], '', '', '');

 

Now what would be even nicer is if the image was a clickable link that goes to the product page.

Link to comment
Share on other sites

A clickable link would be great. Go to includes/modules/product_listing.php and copy the format from there. It's a clickable image product link. It would be added to the definition above for $product_image

 

You will have to add p.product_id to the query in catalog/tell_a_friend.php

(maybe not as the product id is already in the query)

Edited by npn2531

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

Hi All,

 

Great contribution.

 

We do the majority of our business via phone, doing Order placement through http://addons.oscommerce.com/info/1589 Manual Order Entry. Anyone figure how to add the auto-generation of Password normally using admin/crate_account_process.php to the Mail Manager template?

 

Thx.

 

Martin

Link to comment
Share on other sites

For anyone using Manual Order Entry, http://addons.oscommerce.com/info/1589

 

Replace where necesary in file admn/create_account_process.php

 

This generastes two emails, one for new password.

 

//*******start mail manager

if (file_exists(DIR_FS_CATALOG_MODULES.'mail_manager/create_account.php')){

include(DIR_FS_CATALOG_MODULES.'mail_manager/password_forgotten.php');

include(DIR_FS_CATALOG_MODULES.'mail_manager/create_account.php');

}else{

$email_text .= EMAIL_WELCOME . EMAIL_PASS_1 . $new_password . EMAIL_PASS_2 . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;

tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

}

tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS."?Customer=$customer_id", '', 'SSL'));

}

//*******end mail manager

 

You need also to add, define in your admin/includes/languages/english/create_account_process.php:

 

define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - New Password');

define('EMAIL_PASSWORD_REMINDER_BODY', 'A new password was requested from ' . $REMOTE_ADDR . '.' . "\n\n" . 'Your new password to \'' . STORE_NAME . '\' is:' . "\n\n" . ' %s' . "\n\n");

 

Works like a charm.

 

Now have to figure out new order ...

Link to comment
Share on other sites

Anyone here at all? This forum doesn't seem to be monitored. In any even, I'll cast this to the wind: Does anyone know how to keep paragraph breaks in the html email sent by status_update.php ? The comments all run together in HTML. Text outpuit retains the paragraph breaks.

Link to comment
Share on other sites

Ok, more talking to myself.

 

To preserve paragraph breaks in your comment HTML status emails, in:

 

$values=array(HTTP_CATALOG_SERVER,STORE_NAME,STORE_OWNER_EMAIL_ADDRESS, $name, $email_address, EMAIL_TEXT_SUBJECT, $order_no , $order_date, $status_newhtml , $status_newtxt, nl2br($comments), $invoice_url, EMAIL_SEPARATOR);

 

added nl2br() to $comments. But this also adds html to your text message. So, strip html out of your text email as follows, in:

 

tep_mm_sendmail($check_status['customers_name'], $check_status['customers_email_address'], STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $output_subject, $output_content_html, strip_tags($output_content_txt));

 

Added strip_tags() to $output_content_txt.

 

You've been very helpful. Thank you! (Yes, I know, teach a man to fish.)

Link to comment
Share on other sites

  • 3 weeks later...

hello..

 

just like to say first of all that this contribution is wicked and has made my life alot easier.

 

One problem i am having which is not really an issue is when i use the Send Email the success message at the top of the screen does not show the email. I have cross referenced the code with the stock mail.php for the error code and success code that generates this and they are the same, and it does work on the mail.php.

 

Anybody got any ideas on this.

 

Also is there a way to make this work with a visitors email address, someone that just signs up for newsletter without creating an account and the email is stored in another table.???

Link to comment
Share on other sites

Hello

I have installed this nice contribution but on my Admin side, there is something wrong now. The size changed and the boxes are no more here. Somebody has a Idea what I made wrong?

 

Thak you for helping

 

Best regards

 

Marc

Link to comment
Share on other sites

The html on the admin side will be off, as you've noticed, if you use this on 2.3 It will work just fine, but you have play with the layout on the admin side to get it to look right.

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

Thank you for the fast reply, but what do you mean: I have play with the layout. I didn't change the layout on the admin page. Could you please explain me better?

Thank you again and awaiting

 

Best regards

 

Marc

Link to comment
Share on other sites

The admin/mm_bulkmail, and other admin/mm_xxxx pages are set up for OSCommerce 2.2. They will work fine on 2.3 but the html isn't adjusted for 2.3. You can ignore the issue or open up those pages and adjust the html to fit.

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

  • 1 month later...

hello, this contribution is wonderful!

but i have a little problem. When i go to admin>Mail manager>Send email it gives me this:

Fatal error: Call to undefined function tep_hide_session_id() in /home/mx7jjpft/public_html/admin/mm_email.php on line 96

Link to comment
Share on other sites

Hello npn2531,

I am using your contribution Mail Manager for a while now and I see something strange in my store. On some of the customers' orders the Order total value is different(bigger) than the products ordered. This don't happen for all of the orderds. Firstly I was very surpised what is happening but today after I noticed the discrepancy again I contacted my customer and found out that he ordered more products which I could not see in the invoice. Do you have any idea what might be going wrong? I will really appreciate an answer from you.

Thank you,

genata93

Link to comment
Share on other sites

when you create order confirmation email make sure that the placeholder $ordertotal is correct, that it is the order total.

 

note that in the admin>response mail manager the $ordertotal = order total and not delivery address.

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

Hello,

I am looking in the order confirm.php and the can't see placeholder for $ordertotal, the only code that has something to do with order total is this:

 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$mm_ordertotal .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n".'<br/ >';
}

which I can't understand what exactly does. Is the problem here? I think that the order total value I am getting on the orders is correct. The incorrect part is that when I view the invoice I see products that are cheaper than the order total value. For e.g. Order total = 79.80; when view the invoice->

Products Product number Tax Price(no tax) Price(with tax) Total(no tax) Total(with tax)

20 x Some product 172864/HK 0.00% 0,60lv. 0,60lv. 12,00lv. 12,00lv.

Total: 79,50lv.

after I see this I call my client I he tells me he ordered more products and with them the order total is 79.50 which is correct. What should I search or do in this case?

Edited by genata93
Link to comment
Share on other sites

Hi npn2531 , I made your contribution Mail Manager , I had some problems but I read in the forum and I do.

Only 3 words, super, super and super. For moment all it,s ok . :thumbsup: I use 2 languages fr and en - You will be in several languages ​​in the future?

Thanks a lot npn2531 and a Happy New Year to you and all.

Link to comment
Share on other sites

Cata44, If you can translate the files in mail manager/admin/includes/english into French, then perhaps you can add it to the contribution. Or if are uncertain about posting them, then email me the files, or post the files on the forum, I will add it to the contribution.

Edited by npn2531

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...