Jump to:

2082 Posts in 1002 Topics by 452 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » order notify via email

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 720 Views
  • t00thy
    Avatar
    Community Member
    31 Posts

    order notify via email Link to this post

    Hi,

    have anybody know how to creat the notification via e-mail for new orders? Simply it could be the copy of email that has sent to customers. Where can I edit the code?

  • inCharge
    Avatar
    Community Member
    102 Posts

    Re: order notify via email Link to this post

    The code is already there in order.php. See Order::sendReceipt and Order::sendEmail

    See the .ss files in the directory ecommerce/templates/email

    I haven't got this far yet, but I guess you copy those to...

    themes/mytheme_ecommerce/templates/email

    ...and amend as necessary.

    Note that any css must be inline, because these are html email templates, not html web pages.

  • t00thy
    Avatar
    Community Member
    31 Posts

    Re: order notify via email Link to this post

    Thanks so much. I found function $copyToAdmin = true, but the copy did not work for me... so I check the _config file and TaDaa... there was wrong email.

    Thank you.

  • inCharge
    Avatar
    Community Member
    102 Posts

    Re: order notify via email Link to this post

    Toothy, now it's my turn to thank you! I didn't know about copyToAdmin or Email::setAdminEmail, but emails to the store owner were next up on my list.

    Email::setAdminEmail should probably be in most _config.php files, ecommerce or not.

    This is what I have in _config.php now...

    // Default email sender address for the Email class
    // Also receives a copy of ecommerce receipt emails
    Email::setAdminEmail('support@mysite.com');

    // Sender & subject for ecommerce receipt emails
    Order::set_email("Name <sales@mysite.com>");
    Order::set_subject("thank you for your order at www.mysite.com");

    Note:
    - If Email::setAdminEmail is not defined, no receipt is sent to the shop owner - just the customer

    - If Email::setAdminEmail is defined, but not Order::set_email, then setAdminEmail is also the sender of receipts. If neither are defined, the sender of receipts is empty.

    - Order::set_email can include a name
    e.g. 'MySite Sales <sales@mysite.com>'
    ...but Email::setAdminEmail must include just the email address without a name
    e.g. 'sales@mysite.com'
    ...otherwise the receipt emails don't arrive.

    - The Debug::friendlyError function code implies that Email::setAdminEmail is also shown in error pages when no corresponding error page is set up in the CMS (although I didn't test this)

    720 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.