Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: Mailing to customers

    DyO13

    • Neu im Forum
    • Beiträge: 20
    Mailing to customers
    am: 09. April 2015, 17:01:24
    Hallo Liebe Leute,

    I would like to know where is exactly the php code on the shop that send to the customers their order?

    I've been looking a lot, and what i found is "order_mail.html" is exactly the part that i would like to change, but from inside. In there is the html part which is sent to the customers with their account information (in my shop, there is also bank account information, like IBAN, BIC, etc).

    To be clear, i want to know from where come those variables i see on order_mail.html ?

    I need it because of adding a function, as for now when a customer buys something, he get an email with his fully account, it shows everything (also the completely bank info), so i've been asked to make a function to hide some digits on the IBAN output (for security purpose).

    Im doing the php part (haven't test it yet, im also having some problems of how to test it by sending me emails to localhost  :datz: .

    Any advice will be very appreciate it! I've been searching the whole day, got some things but couldn't find everything i need yet. Thanks in advance!  :-)

    Linkback: https://www.modified-shop.org/forum/index.php?topic=32681.0

    hendrik

    • Experte
    • Beiträge: 2.038
    Re: Mailing to customers
    Antwort #1 am: 09. April 2015, 21:39:13
    Its send_order.php
    Included by checkout_process.php

    mfg
    hen

    DyO13

    • Neu im Forum
    • Beiträge: 20
    Re: Mailing to customers
    Antwort #2 am: 10. April 2015, 10:58:10
    Its send_order.php
    Included by checkout_process.php

    mfg
    hen

    First of all thanks for the reply!

    I've already checked those files, and is true that 'send_order.php' is what send 'order_mail.html' to the customers with their '$address' and so.

    But i'd like to know how to manage those variables? i mean, let's suppose i want to modify their email to not been completly seen, which is sent on order_mail.html under the variable '$email'.

    Email: {$email}
    Address: {$address}

    The email is something like pepito@hotmail.com.

    so, where can i change the variable $email (which contain pepito@hotmail.com) or where can i call a function that modify $email variable ?

    I've already made a function (just added on inc folder) "xtc_hide_email.php", where i basically get the '$email' variable and converts to this  'pe********mail.com' (actually i hide the first and last 5 chars, but doesn't matter,it's just an example)

    This change is only for output(visible for customers ofc), since we do need the IBAN

    So when the order_mail is sent to the customer, he will get :

    "Hello pepito,

    blablabla

    address: his address
    email: pe********mail.com
    telfnummer: 1234566
    and so ...."

    So i have the function, but don't know how and where to call it, for replace the current variable to mine.

    Note: Im chaging the IBAN, which is not on original shop but implemented on our shop, so any easy example with $EMAIL would fit aswell. Thanks a lot

    hendrik

    • Experte
    • Beiträge: 2.038
    Re: Mailing to customers
    Antwort #3 am: 11. April 2015, 08:11:50
    In send_order.php you see many lines like:

    Code: PHP  [Auswählen]
    $smarty->assign('VARNAME',  $value );

    There is any line to define customers email address:

    Code: PHP  [Auswählen]
    $smarty->assign('EMAIL', $order->customer['email_address']);

    Here you can define any onw variable. Insert new line:

    Code: PHP  [Auswählen]
    $smarty->assign('EMAIL_HIDDEN',   xtc_hide_email( $order->customer['email_address'] )       );

    In the Template file you can use it now so:

    Zitat
    Email: {$EMAIL_HIDDEN}

    Don't forget to include your hiding function before.
    require_once (DIR_FS_INC.'xtc_hide_email.inc.php');

    The System generates multi-formated Mails. You have to edit the templates 2 times. html and ascii. order_mail.html and order_mail.txt

    greeting
    hen

    DyO13

    • Neu im Forum
    • Beiträge: 20
    Re: Mailing to customers
    Antwort #4 am: 13. April 2015, 12:21:04
    In send_order.php you see many lines like:

    Code: PHP  [Auswählen]
    $smarty->assign('VARNAME',  $value );

    There is any line to define customers email address:

    Code: PHP  [Auswählen]
    $smarty->assign('EMAIL', $order->customer['email_address']);

    Here you can define any onw variable. Insert new line:

    Code: PHP  [Auswählen]
    $smarty->assign('EMAIL_HIDDEN',   xtc_hide_email( $order->customer['email_address'] )       );

    In the Template file you can use it now so:

    Zitat
    Email: {$EMAIL_HIDDEN}

    Don't forget to include your hiding function before.
    require_once (DIR_FS_INC.'xtc_hide_email.inc.php');

    The System generates multi-formated Mails. You have to edit the templates 2 times. html and ascii. order_mail.html and order_mail.txt

    greeting
    hen

    Can't thanks enough for your response. It works now, had some other problems but was mailing problems that i already fix, but how you explain it to me was perfectly. Thanks so much, i really appreciate it.  :-D

    Have a really nice day :-)
    8 Antworten
    3930 Aufrufe
    09. Oktober 2010, 15:45:53 von DerNachbar
    14 Antworten
    6388 Aufrufe
    19. März 2013, 21:44:34 von jannemann
    6 Antworten
    2030 Aufrufe
    21. Juni 2017, 19:48:01 von Toby
               
    anything