PluginProbe
ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce / 1.6.7
ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce v1.6.7
1.17.10 1.17.9 1.17.8 1.17.7 1.17.6 1.17.5 1.17.4 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.3.0 1.3.1 1.3.11 1.3.12 1.3.13 1.3.14 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 All 144 releases
erp / modules / accounting / includes / emails / class-email-transections.php

class-email-transections.php in ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce 1.6.7, at modules/accounting/includes/emails/class-email-transections.php

64 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WeDevs\ERP\Accounting\Includes\Emails;
4
5 use WeDevs\ERP\Email;
6 use WeDevs\ERP\Framework\Traits\Hooker;
7
8 /**
9 * Approved Leave Request
10 */
11 class Transactional_Email extends Email {
12 use Hooker;
13
14 public function __construct() {
15 $this->id = 'transectional-email';
16 $this->title = __( 'New transaction invoice', 'erp' );
17 $this->description = __( 'New invoice notification alert', 'erp' );
18
19 $this->subject = __( 'New invoice has been created', 'erp' );
20 $this->heading = __( 'New transaction invoice', 'erp' );
21
22 $this->find = [
23 'customer_name' => '{customer_name}',
24 'invoide_ID' => '{invoide_ID}',
25 'amount' => '{amount}',
26 'due_date' => '{due_date}',
27 'company_name' => '{company_name}',
28 ];
29
30 $this->action( 'erp_admin_field_' . $this->id . '_help_texts', 'replace_keys' );
31
32 parent::__construct();
33 }
34
35 public function get_args() {
36 return [
37 'email_heading' => $this->heading,
38 'email_body' => wpautop( $this->get_option( 'body' ) ),
39 ];
40 }
41
42 public function trigger( $receiver_email, $attachment = '', $voucher_no, $company ) {
43 $this->recipient = $receiver_email;
44 $this->heading = $this->get_option( 'heading', $this->heading );
45 $this->subject = $this->get_option( 'subject', $this->subject );
46
47 $voucher_details = erp_acct_get_invoice( $voucher_no );
48
49 $this->replace = [
50 'customer_name' => $voucher_details['customer_name'],
51 'invoide_ID' => $voucher_no,
52 'amount' => $voucher_details['amount'],
53 'due_date' => $voucher_details['due_date'],
54 'company_name' => $company->name,
55 ];
56
57 if ( ! $this->get_recipient() ) {
58 return;
59 }
60
61 $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $attachment );
62 }
63 }
64