PHP code example of arraypress / wp-register-emails

1. Go to this page and download the library: Download arraypress/wp-register-emails library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

arraypress / wp-register-emails example snippets


register_email_tag( 'shop', 'customer_name', [
	'label'    => __( 'Customer name', 'my-plugin' ),
	'callback' => fn( $order ) => $order->billing_name,
	'preview'  => 'Jane Doe',
] );

register_email( 'shop', 'receipt', [
	'subject' => __( 'Your order from {site_name}', 'my-plugin' ),
	'content' => __( 'Thanks, {customer_name}.', 'my-plugin' ),
] );

send_registered_email( 'shop', 'receipt', [ 'to' => $order->email ] );