Anish Joshi

do you know what the line of code is sorry? can't seem to find it, i've got the email from set up

Anish Joshi

@wmk thanks for that, where can I set where the email add gets sent to?

wmk

@Anish Joshi did you have a look at the docs? https://github.com/silvershop/silvershop-core/blob/master/docs/en/02_Customisation/Emails.md should cover this question

Show 1 attachment(s)
docs/en/02_Customisation/Emails.md

Shop emails can be customised to suit your project needs.

## Enable / disable sending of emails

There are a few yaml config options that will affect which emails are sent:

```yaml
SilverShop\Checkout\OrderProcessor:
  #send order confirmation when order is placed, but unpaid
  send_confirmation: true

#send a bcc copy of emails to administrator
SilverShop\Checkout\OrderEmailNotifier:
  bcc_confirmation_to_admin: true
  bcc_receipt_to_admin: true

#Specify the 'from' address to use in email correspondence
SilverShop\Extension\ShopConfigExtension:
  email_from: <mailto:[email protected]|[email protected]>

Modifying templates

Update email content by overriding the templates inside the templates/email/ folder. Just create a corresponding folder/template in your mysite folder, such as mysite/templates/email/Order_RecieptEmail.

Modifying subject lines

Email subjects are in the translation system, so you can do the following to change an email subject line:

#in mysite/lang/en.yml
en:
  ShopEmail:
    ConfirmationSubject: 'My Website Order #{OrderNo} confirmation'
    ReceiptSubject: 'My Website Order #{OrderNo} receipt'
    CancelSubject: 'My Website Order #{OrderNo} cancelled by member'  

Making your own Notifier

There may be times when you want to add custom logic around the e-mail. For instance if your purchase requires your user to enter e-mail addresses and each of those addresses receives a different confirmation e-mail. In this situation make a MyCustomOrderEmailNotifier that can optionally extend OrderEmailNotifier and add custom logic into it then declare it to replace the current notifier

# in mysite/config.yml
Injector:
  OrderEmailNotifier:
    class: MyCustomOrderEmailNotifier
Hide attachment content
Anish Joshi

Anyone know where I set the email to for notifications when someone buys something on my silvershop store?

madman

And look at using lumberjack in the CMS to manage the Product pages

👍 (1)
wmk

afaik it can handle it, yes. You might want to cache as much as possible or use e.g. an ajax based cart with static publisher

LiamC

could silvershop / silverstripe handle 3000 products / 3000 pages. Or is there a way to remove them from the sitetree and make them model admin controlled?

null

Could be that your guest does not have a value in the Email field

webcam

Yeah, so long story short @null. We fixed the email setup by setting the email config.yml as per:

  1. SilverStripe\Core\Injector\Injector:
  2. Swift_Transport: Swift_SendmailTransport

Which took a long time to figure out.. as this was the first time we have ever needed to do any email config setup (we normally just use the default silverstripe email functionality) which appears to be what SilverShop uses anyway..

And yeah this was still happening while we had set the:

  1. SilverStripe\Control\Email\Email:
  2. send_all_emails_from

Wasnt until after we used the Swift_Transport config it was all happy to work

null

yeah, I had a similar problem. Password reset emails weren't going out until I set "send_all_emails_from". The problem with that is that all emails get sent "from" that address, including those you specifically configure with a From address. Mostly resolved with Mailgun*, but not fully solved

null

I raised a bug about it here, but there's no good solution: https://github.com/silverstripe/silverstripe-cms/issues/2412

Show 1 attachment(s)
elliot-sawyer

Versions affected:
SS 4.3.3

Steps to reproduce:

  1. Visit /Security/lostpassword
  2. Enter a valid email address to trigger the email

Description:
I'm using Sentry for error reporting and it grabs the following user_error: [error-log] Uncaught Exception Swift_TransportException: "Cannot send message without a sender address" at ... .
The email that gets sent from the LostPasswordHandler::sendMail method does not contain a From: address. This prevents the email from being sent.

As a workaround, you can set the following in your YML config:

SilverStripe\Control\Email\Email:
  send_all_emails_from: '<mailto:[email protected]|[email protected]>'

Unfortunately, that setting applies to all emails, including those you've configured in your own codebase that may have a different reply-to address. It's not a requirement to set this variable up to run SilverStripe, but it seems nobody can trigger a password reset email until one is set.

Hide attachment content