Jump to content



Orders update email


  • Please log in to reply
8 replies to this topic

#1   Gergely

Gergely

    Action Hero

  • Community Team
  • 969 posts
  • Real Name:Gergely Tóth
  • Gender:Male
  • Location:Budapest

Posted 01 August 2009 - 03:25 PM

Hi,

How can I add really line feed into admin\includes\languages\en_US\orders.php  email_body?


email_body = %s
------------------------------------------------------
Order Number: %s
Detailed Invoice: %s
Date Ordered: %s
email_body_comment = Order Comment
------------------------------------------------------
%s

The results now:
Teszt Shop------------------------------------------------------Order Number: 2Detailed Invoice: http://webshop.hu/account_history_info.php?order_id=2Ordered Date: szerda 29 július, 2009

Start in:
admin/includes/application/orders/orders.php
about in line 206
$email_body = sprintf($osC_Language->get('email_body'), STORE_NAME, $id, osc_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $id, 'SSL', false, false, true), osC_DateTime::getLong($Qorder->value('date_purchased'))) . "\n\n";

I would like to to see in separated lines in email.
like this:

Teszt Shop
------------------------------------------------------
Order Number: 2
Detailed Invoice: http://webshop.hu/account_history_info.php?order_id=2
Ordered Date: szerda 29 július, 2009

Have you got any tips?
some rewrites :-)

#2   multimixer

multimixer

    Lemons or Melons ?

  • Partner
  • 4,512 posts
  • Real Name:George Zarkadas
  • Gender:Male
  • Location:Greece

Posted 01 August 2009 - 03:55 PM

I think you will find the answer you need in this topic email issues

#3   Gergely

Gergely

    Action Hero

  • Community Team
  • 969 posts
  • Real Name:Gergely Tóth
  • Gender:Male
  • Location:Budapest

Posted 02 August 2009 - 08:17 AM

View Postmultimixer, on Aug 1 2009, 05:55 PM, said:

I think you will find the answer you need in this topic email issues

Thanks!

This is usefull for new contribs, but very complicated. I'm looking for simply method.
some rewrites :-)

#4   hendo42

hendo42
  • Members
  • 5 posts
  • Real Name:Brian Henderson

Posted 14 October 2009 - 06:23 PM

View PostGergely, on 02 August 2009 - 08:17 AM, said:

Thanks!

This is usefull for new contribs, but very complicated. I'm looking for simply method.


Here's a simple answer... Using vi, insert a ctrl-L after each line you wish to have a newline on.

In vi:

Go to insert mode (i) then press ctrl-V, then press ctrl-L.  Voila you will see the ^L.

#5   deyangggg

deyangggg
  • Members
  • 1 posts
  • Real Name:Deyan

Posted 10 November 2010 - 08:18 AM

Hi,

I have the same problem with OSC v.3. The update order email is not displayed properly.
It is something like:

OsCommerce shop------------------------------------------------------Order Number: 26Detailed Invoice: http://myshop.com/toys/account_history_info.php?order_id=26Date Ordered: 09.11.2010
Comment------------------------------------------------------

Status------------------------------------------------------New Status: Preparing


Is there any way I can fix this?


Thanks a lot,
Deyan

#6   Gergely

Gergely

    Action Hero

  • Community Team
  • 969 posts
  • Real Name:Gergely Tóth
  • Gender:Male
  • Location:Budapest

Posted 10 November 2010 - 06:37 PM

View Postdeyangggg, on 10 November 2010 - 08:18 AM, said:

Hi,

I have the same problem with OSC v.3. The update order email is not displayed properly.
It is something like:

OsCommerce shop------------------------------------------------------Order Number: 26Detailed Invoice: http://myshop.com/to...order_id=26Date Ordered: 09.11.2010
Comment------------------------------------------------------

Status------------------------------------------------------New Status: Preparing


Is there any way I can fix this?


Thanks a lot,
Deyan

Hi,

Use this contribution
some rewrites :-)

#7   blackwater

blackwater
  • Members
  • 163 posts
  • Real Name:Paul

Posted 10 November 2010 - 10:37 PM

View PostGergely, on 01 August 2009 - 03:25 PM, said:

Hi,

How can I add really line feed into admin\includes\languages\en_US\orders.php  email_body?


email_body = %s
------------------------------------------------------
Order Number: %s
Detailed Invoice: %s
Date Ordered: %s
email_body_comment = Order Comment
------------------------------------------------------
%s

The results now:
Teszt Shop------------------------------------------------------Order Number: 2Detailed Invoice: http://webshop.hu/account_history_info.php?order_id=2Ordered Date: szerda 29 július, 2009

Start in:
admin/includes/application/orders/orders.php
about in line 206
$email_body = sprintf($osC_Language->get('email_body'), STORE_NAME, $id, osc_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $id, 'SSL', false, false, true), osC_DateTime::getLong($Qorder->value('date_purchased'))) . "\n\n";

I would like to to see in separated lines in email.
like this:

Teszt Shop
------------------------------------------------------
Order Number: 2
Detailed Invoice: http://webshop.hu/account_history_info.php?order_id=2
Ordered Date: szerda 29 július, 2009

Have you got any tips?


You will need to control the dotted line by making it a variable. eg;

email_order_sep	= ------------------------------------------------------

and in creating your email you call it like:

$email_body .= $osC_Language->get('email_order_sep') . "\n";


#8   deyangg

deyangg
  • Members
  • 2 posts

Posted 10 January 2011 - 12:22 PM

View PostGergely, on 10 November 2010 - 06:37 PM, said:


Hi,

if I install this contribute I may delete some of the mods I've done.
Can you please tell me what is the solution of the email showing at one line and how can I fix it?

Thanks a lot,
Deyan

#9   Gergely

Gergely

    Action Hero

  • Community Team
  • 969 posts
  • Real Name:Gergely Tóth
  • Gender:Male
  • Location:Budapest

Posted 10 January 2011 - 03:06 PM

View Postdeyangg, on 10 January 2011 - 12:22 PM, said:

Hi,

if I install this contribute I may delete some of the mods I've done.
Can you please tell me what is the solution of the email showing at one line and how can I fix it?

Thanks a lot,
Deyan

Hi,


OSCOM Admin email Line Feeder
When admin sent emails, the LF operation was missed.
This modification use oscommerce name standard to generate email line feeds.
The name standard "email_" in language files. When the keys start as "email_"
the feeder add after one "\n" LF operator in each new rows.


Find in catalog/admin/includes/classes/language.php

Change:

		  if ( $delimiter !== false ) {
			$key = trim(substr($line, 0, $delimiter));
			$value = trim(substr($line, $delimiter + 1));

			$ini_array[$key] = $value;
		  } elseif ( isset($key) ) {
			$ini_array[$key] .= trim($line);
		  }

to:

		  if ( $delimiter !== false ) {
			$key = trim(substr($line, 0, $delimiter));
			$value = trim(substr($line, $delimiter + 1));

			$ini_array[$key] = $value;
			if ( substr($key, 0, 6 ) == 'email_' ) { //admin email text LF slicer
			  $ini_array[$key] .= "\n"; // slice first row
			}
		  } elseif ( isset($key) ) {
			$ini_array[$key] .= trim($line);
			if ( substr($key, 0, 6 ) == 'email_' ) { //admin email text LF slicer
			  $ini_array[$key] .= "\n"; // slice more rows
			}
		  } 


Method:

You can find admin language in files. (orders.php)
When one language definition start with "email_"

ie:

email_body = %s
------------------------------------------------------

the program code change linefeeds to "\n".

Nothing to do only edit in simple text editor. If you press enter in text (as LF) the program interprets as LF.

email_body = %s
I write here this text
 ------------------------------------------------------
 email_body_comment = Order Comment
------------------------------------------------------
and I write here something
%s

You can see like this in recived email:

balbalbal
I write here this text
------------------------------------------------------

blablabla
------------------------------------------------------
and I write here something
blablabla
some rewrites :-)