PHP Class OrderEmailNotifier, silvershop-core

Show file Open project: burnbright/silverstripe-shop Class Usage Examples

Protected Properties

Property Type Description
$debugMode boolean
$order Order

Public Methods

Method Description
__construct ( Order $order ) Assign the order to a local variable
config ( )
create ( Order $order ) : OrderEmailNotifier
sendAdminNotification ( ) Notify store owner about new order.
sendCancelNotification ( ) Sends an email to the admin that an order has been cancelled
sendConfirmation ( ) Send customer a confirmation that the order has been received
sendEmail ( $template, $subject, $copyToAdmin = true ) : boolean Send a mail of the order to the client (and another to the admin).
sendReceipt ( ) Send customer an order receipt email.
sendStatusChange ( string $title, string $note = null ) Send an email to the customer containing the latest note of {@link OrderStatusLog} and the current status.
setDebugMode ( $bool )

Protected Methods

Method Description
buildEmail ( string $template, string $subject ) : Email

Method Details

__construct() public method

Assign the order to a local variable
public __construct ( Order $order )
$order Order

buildEmail() protected method

protected buildEmail ( string $template, string $subject ) : Email
$template string
$subject string
return Email

config() public static method

public static config ( )

create() public static method

public static create ( Order $order ) : OrderEmailNotifier
$order Order
return OrderEmailNotifier

sendAdminNotification() public method

Notify store owner about new order.

sendCancelNotification() public method

Sends an email to the admin that an order has been cancelled

sendConfirmation() public method

Send customer a confirmation that the order has been received
public sendConfirmation ( )

sendEmail() public method

Send a mail of the order to the client (and another to the admin).
public sendEmail ( $template, $subject, $copyToAdmin = true ) : boolean
$template - the class name of the email you wish to send
$subject - subject of the email
$copyToAdmin - true by default, whether it should send a copy to the admin
return boolean

sendReceipt() public method

Precondition: The order payment has been successful
public sendReceipt ( )

sendStatusChange() public method

Send an email to the customer containing the latest note of {@link OrderStatusLog} and the current status.
public sendStatusChange ( string $title, string $note = null )
$title string Subject for email
$note string Optional note-content (instead of using the OrderStatusLog)

setDebugMode() public method

public setDebugMode ( $bool )
$bool

Property Details

$debugMode protected property

protected bool $debugMode
return boolean

$order protected property

protected Order $order
return Order