Jump to content



Photo

Orders update email


  • Please log in to reply
8 replies to this topic

#1 ONLINE   Gergely

Gergely

    Action Hero

  • Community Team
  • 1,194 posts
  • Real Name:Gergely Tóth
  • Gender:Male
  • Location:Budapest

Posted 01 August 2009 - 15:25

Hi,

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


email_body = %s------------------------------------------------------Order Number: %sDetailed Invoice: %sDate Ordered: %semail_body_comment = Order Comment------------------------------------------------------%s

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

Start in:
admin/includes/application/orders/orders.php
about in line 206

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

Teszt Shop
------------------------------------------------------
Order Number: 2
Detailed Invoice: http://webshop.hu/ac....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,560 posts
  • Real Name:George Zarkadas
  • Gender:Male
  • Location:Greece

Posted 01 August 2009 - 15:55

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

#3 ONLINE   Gergely

Gergely

    Action Hero

  • Community Team
  • 1,194 posts
  • Real Name:Gergely Tóth
  • Gender:Male
  • Location:Budapest

Posted 02 August 2009 - 08:17

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 - 18:23

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

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

#6 ONLINE   Gergely

Gergely

    Action Hero

  • Community Team
  • 1,194 posts
  • Real Name:Gergely Tóth
  • Gender:Male
  • Location:Budapest

Posted 10 November 2010 - 18:37

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 - 22:37

Hi,

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


email_body = %s------------------------------------------------------Order Number: %sDetailed Invoice: %sDate Ordered: %semail_body_comment = Order Comment------------------------------------------------------%s

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

Start in:
admin/includes/application/orders/orders.php
about in line 206

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

Teszt Shop
------------------------------------------------------
Order Number: 2
Detailed Invoice: http://webshop.hu/ac....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

Hi,

Use this contribution


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 ONLINE   Gergely

Gergely

    Action Hero

  • Community Team
  • 1,194 posts
  • Real Name:Gergely Tóth
  • Gender:Male
  • Location:Budapest

Posted 10 January 2011 - 15:06

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 :-