# erp/1.6.7/modules/accounting/includes/emails/class-email-transections.php

ERP: Complete HR, Accounting &amp; CRM Suite Built for WooCommerce, version 1.6.7. 64 lines.

- Page: https://pluginprobe.com/plugins/erp/1.6.7/code/modules/accounting/includes/emails/class-email-transections.php
- Raw: https://pluginprobe.com/plugins/erp/1.6.7/raw/modules/accounting/includes/emails/class-email-transections.php
- Modified: 2020-10-29T12:26:44+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/erp/1.6.7/code/modules/accounting/includes/emails/class-email-transections.php#L10-L20`.

```php
<?php

namespace WeDevs\ERP\Accounting\Includes\Emails;

use WeDevs\ERP\Email;
use WeDevs\ERP\Framework\Traits\Hooker;

/**
 * Approved Leave Request
 */
class Transactional_Email extends Email {
    use Hooker;

    public function __construct() {
        $this->id             = 'transectional-email';
        $this->title          = __( 'New transaction invoice', 'erp' );
        $this->description    = __( 'New invoice notification alert', 'erp' );

        $this->subject        = __( 'New invoice has been created', 'erp' );
        $this->heading        = __( 'New transaction invoice', 'erp' );

        $this->find = [
            'customer_name' => '{customer_name}',
            'invoide_ID'    => '{invoide_ID}',
            'amount'        => '{amount}',
            'due_date'      => '{due_date}',
            'company_name'  => '{company_name}',
        ];

        $this->action( 'erp_admin_field_' . $this->id . '_help_texts', 'replace_keys' );

        parent::__construct();
    }

    public function get_args() {
        return [
            'email_heading' => $this->heading,
            'email_body'    => wpautop( $this->get_option( 'body' ) ),
        ];
    }

    public function trigger( $receiver_email, $attachment = '', $voucher_no, $company ) {
        $this->recipient   = $receiver_email;
        $this->heading     = $this->get_option( 'heading', $this->heading );
        $this->subject     = $this->get_option( 'subject', $this->subject );

        $voucher_details = erp_acct_get_invoice( $voucher_no );

        $this->replace = [
            'customer_name' => $voucher_details['customer_name'],
            'invoide_ID'    => $voucher_no,
            'amount'        => $voucher_details['amount'],
            'due_date'      => $voucher_details['due_date'],
            'company_name'  => $company->name,
        ];

        if ( ! $this->get_recipient() ) {
            return;
        }

        $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $attachment );
    }
}

```
