@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Displays invoice details in emails. |
| 4 | 4 | * |
@@ -8,17 +8,17 @@ discard block |
||
| 8 | 8 | * @var WPInv_Invoice $invoice |
| 9 | 9 | * @var array $columns |
| 10 | 10 | */ |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | + defined( 'ABSPATH' ) || exit; |
|
| 12 | 12 | |
| 13 | -$meta_data = getpaid_get_invoice_meta( $invoice ); |
|
| 13 | + $meta_data = getpaid_get_invoice_meta( $invoice ); |
|
| 14 | 14 | |
| 15 | -if ( isset( $meta_data['status'] ) ) { |
|
| 16 | - $meta_data['status']['value'] = $invoice->get_status_nicename(); |
|
| 15 | + if ( isset( $meta_data['status'] ) ) { |
|
| 16 | + $meta_data['status']['value'] = $invoice->get_status_nicename(); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | -do_action( 'wpinv_email_before_invoice_details', $invoice, $sent_to_admin ); |
|
| 19 | + do_action( 'wpinv_email_before_invoice_details', $invoice, $sent_to_admin ); |
|
| 20 | 20 | |
| 21 | -?> |
|
| 21 | + ?> |
|
| 22 | 22 | |
| 23 | 23 | <div id="wpinv-email-details"> |
| 24 | 24 | |
@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | <table class="table table-bordered table-sm"> |
| 30 | 30 | |
| 31 | 31 | <?php foreach ( $meta_data as $key => $data ) : ?> |
| 32 | - |
|
| 32 | + |
|
| 33 | 33 | <?php if ( ! empty( $data['value'] ) ) : ?> |
| 34 | - |
|
| 34 | + |
|
| 35 | 35 | <?php do_action( "getpaid_before_email_details_$key", $invoice, $data ); ?> |
| 36 | 36 | |
| 37 | 37 | <tr class="getpaid-email-details-<?php echo esc_attr( $key ); ?>"> |
@@ -47,9 +47,9 @@ discard block |
||
| 47 | 47 | </tr> |
| 48 | 48 | |
| 49 | 49 | <?php do_action( "getpaid_after_email_details_$key", $invoice, $data ); ?> |
| 50 | - |
|
| 50 | + |
|
| 51 | 51 | <?php endif; ?> |
| 52 | - |
|
| 52 | + |
|
| 53 | 53 | <?php endforeach; ?> |
| 54 | 54 | |
| 55 | 55 | </table> |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Template that generates the expired subscription email. |
| 4 | 4 | * |
@@ -8,18 +8,18 @@ discard block |
||
| 8 | 8 | * @var WPInv_Subscription $object |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | + defined( 'ABSPATH' ) || exit; |
|
| 12 | 12 | |
| 13 | -$invoice = $object->get_parent_payment(); |
|
| 13 | + $invoice = $object->get_parent_payment(); |
|
| 14 | 14 | |
| 15 | -// Print the email header. |
|
| 16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 15 | + // Print the email header. |
|
| 16 | + do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 17 | 17 | |
| 18 | -// Generate the custom message body. |
|
| 19 | -echo wp_kses_post( $message_body ); |
|
| 18 | + // Generate the custom message body. |
|
| 19 | + echo wp_kses_post( $message_body ); |
|
| 20 | 20 | |
| 21 | -// Print the billing details. |
|
| 22 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 21 | + // Print the billing details. |
|
| 22 | + do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 23 | 23 | |
| 24 | -// Print the email footer. |
|
| 25 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 24 | + // Print the email footer. |
|
| 25 | + do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Template that generates the email styles. |
| 4 | 4 | * |
@@ -7,22 +7,22 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | + defined( 'ABSPATH' ) || exit; |
|
| 11 | 11 | |
| 12 | -$bg = wpinv_get_option( 'email_background_color', '#f5f5f5' ); |
|
| 13 | -$body = wpinv_get_option( 'email_body_background_color', '#fdfdfd' ); |
|
| 14 | -$base = wpinv_get_option( 'email_base_color', '#557da2' ); |
|
| 15 | -$base_text = wpinv_light_or_dark( $base, '#202020', '#ffffff' ); |
|
| 16 | -$text = wpinv_get_option( 'email_text_color', '#505050' ); |
|
| 12 | + $bg = wpinv_get_option( 'email_background_color', '#f5f5f5' ); |
|
| 13 | + $body = wpinv_get_option( 'email_body_background_color', '#fdfdfd' ); |
|
| 14 | + $base = wpinv_get_option( 'email_base_color', '#557da2' ); |
|
| 15 | + $base_text = wpinv_light_or_dark( $base, '#202020', '#ffffff' ); |
|
| 16 | + $text = wpinv_get_option( 'email_text_color', '#505050' ); |
|
| 17 | 17 | |
| 18 | -$bg_darker_10 = wpinv_hex_darker( $bg, 10 ); |
|
| 19 | -$body_darker_10 = wpinv_hex_darker( $body, 10 ); |
|
| 20 | -$base_lighter_20 = wpinv_hex_lighter( $base, 20 ); |
|
| 21 | -$base_lighter_40 = wpinv_hex_lighter( $base, 40 ); |
|
| 22 | -$text_lighter_20 = wpinv_hex_lighter( $text, 20 ); |
|
| 18 | + $bg_darker_10 = wpinv_hex_darker( $bg, 10 ); |
|
| 19 | + $body_darker_10 = wpinv_hex_darker( $body, 10 ); |
|
| 20 | + $base_lighter_20 = wpinv_hex_lighter( $base, 20 ); |
|
| 21 | + $base_lighter_40 = wpinv_hex_lighter( $base, 40 ); |
|
| 22 | + $text_lighter_20 = wpinv_hex_lighter( $text, 20 ); |
|
| 23 | 23 | |
| 24 | -// !important; is a gmail hack to prevent styles being stripped if it doesn't like something. |
|
| 25 | -?> |
|
| 24 | + // !important; is a gmail hack to prevent styles being stripped if it doesn't like something. |
|
| 25 | + ?> |
|
| 26 | 26 | #wrapper { |
| 27 | 27 | background-color: <?php echo esc_attr( $bg ); ?>; |
| 28 | 28 | margin: 0; |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Template that generates the cancelled subscription email. |
| 4 | 4 | * |
@@ -8,18 +8,18 @@ discard block |
||
| 8 | 8 | * @var WPInv_Subscription $object |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | + defined( 'ABSPATH' ) || exit; |
|
| 12 | 12 | |
| 13 | -$invoice = $object->get_parent_payment(); |
|
| 13 | + $invoice = $object->get_parent_payment(); |
|
| 14 | 14 | |
| 15 | -// Print the email header. |
|
| 16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 15 | + // Print the email header. |
|
| 16 | + do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 17 | 17 | |
| 18 | -// Generate the custom message body. |
|
| 19 | -echo wp_kses_post( $message_body ); |
|
| 18 | + // Generate the custom message body. |
|
| 19 | + echo wp_kses_post( $message_body ); |
|
| 20 | 20 | |
| 21 | -// Print the billing details. |
|
| 22 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 21 | + // Print the billing details. |
|
| 22 | + do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 23 | 23 | |
| 24 | -// Print the email footer. |
|
| 25 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 24 | + // Print the email footer. |
|
| 25 | + do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
@@ -1,12 +1,12 @@ |
||
| 1 | -<?php |
|
| 2 | -// don't load directly |
|
| 3 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 4 | - die( '-1' ); |
|
| 1 | + <?php |
|
| 2 | + // don't load directly |
|
| 3 | + if ( ! defined( 'ABSPATH' ) ) { |
|
| 4 | + die( '-1' ); |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$email_footer = apply_filters( 'wpinv_email_footer_text', wpinv_get_option( 'email_footer_text', get_bloginfo( 'name', 'display' ) . ' - ' . __( 'Powered by GetPaid', 'invoicing' ) ) ); |
|
| 8 | -$email_footer = $email_footer ? wp_kses_post( wpautop( wptexturize( $email_footer ) ) ) : ''; |
|
| 9 | -?> |
|
| 7 | + $email_footer = apply_filters( 'wpinv_email_footer_text', wpinv_get_option( 'email_footer_text', get_bloginfo( 'name', 'display' ) . ' - ' . __( 'Powered by GetPaid', 'invoicing' ) ) ); |
|
| 8 | + $email_footer = $email_footer ? wp_kses_post( wpautop( wptexturize( $email_footer ) ) ) : ''; |
|
| 9 | + ?> |
|
| 10 | 10 | </div> |
| 11 | 11 | </td> |
| 12 | 12 | </tr> |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Template that generates the overdue emails. |
| 4 | 4 | * |
@@ -7,22 +7,22 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | + defined( 'ABSPATH' ) || exit; |
|
| 11 | 11 | |
| 12 | -// Print the email header. |
|
| 13 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 12 | + // Print the email header. |
|
| 13 | + do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 14 | 14 | |
| 15 | -// Generate the custom message body. |
|
| 16 | -echo wp_kses_post( $message_body ); |
|
| 15 | + // Generate the custom message body. |
|
| 16 | + echo wp_kses_post( $message_body ); |
|
| 17 | 17 | |
| 18 | -// Print invoice details. |
|
| 19 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 18 | + // Print invoice details. |
|
| 19 | + do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 20 | 20 | |
| 21 | -// Print invoice items. |
|
| 22 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 21 | + // Print invoice items. |
|
| 22 | + do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 23 | 23 | |
| 24 | -// Print the billing details. |
|
| 25 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 24 | + // Print the billing details. |
|
| 25 | + do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 26 | 26 | |
| 27 | -// Print the email footer. |
|
| 28 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 27 | + // Print the email footer. |
|
| 28 | + do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Template that generates the new invoice email. |
| 4 | 4 | * |
@@ -7,22 +7,22 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | + defined( 'ABSPATH' ) || exit; |
|
| 11 | 11 | |
| 12 | -// Print the email header. |
|
| 13 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 12 | + // Print the email header. |
|
| 13 | + do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 14 | 14 | |
| 15 | -// Generate the custom message body. |
|
| 16 | -echo wp_kses_post( $message_body ); |
|
| 15 | + // Generate the custom message body. |
|
| 16 | + echo wp_kses_post( $message_body ); |
|
| 17 | 17 | |
| 18 | -// Print invoice details. |
|
| 19 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 18 | + // Print invoice details. |
|
| 19 | + do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 20 | 20 | |
| 21 | -// Print invoice items. |
|
| 22 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 21 | + // Print invoice items. |
|
| 22 | + do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 23 | 23 | |
| 24 | -// Print the billing details. |
|
| 25 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 24 | + // Print the billing details. |
|
| 25 | + do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 26 | 26 | |
| 27 | -// Print the email footer. |
|
| 28 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 27 | + // Print the email footer. |
|
| 28 | + do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Displays single line items in emails. |
| 4 | 4 | * |
@@ -10,11 +10,11 @@ discard block |
||
| 10 | 10 | * @var array $columns |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -defined( 'ABSPATH' ) || exit; |
|
| 13 | + defined( 'ABSPATH' ) || exit; |
|
| 14 | 14 | |
| 15 | -?> |
|
| 16 | - |
|
| 17 | -<?php do_action( 'getpaid_before_email_line_item', $invoice, $item ); ?> |
|
| 15 | + ?> |
|
| 16 | + |
|
| 17 | + <?php do_action( 'getpaid_before_email_line_item', $invoice, $item ); ?> |
|
| 18 | 18 | |
| 19 | 19 | <tr class="wpinv_cart_item item-type-<?php echo esc_attr( $item->get_type() ); ?>"> |
| 20 | 20 | |
@@ -24,52 +24,52 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | <?php |
| 26 | 26 | |
| 27 | - // Fires before printing a line item column. |
|
| 28 | - do_action( "getpaid_email_line_item_before_$column", $item, $invoice ); |
|
| 27 | + // Fires before printing a line item column. |
|
| 28 | + do_action( "getpaid_email_line_item_before_$column", $item, $invoice ); |
|
| 29 | 29 | |
| 30 | - // Item name. |
|
| 31 | - if ( 'name' == $column ) { |
|
| 30 | + // Item name. |
|
| 31 | + if ( 'name' == $column ) { |
|
| 32 | 32 | |
| 33 | - // Display the name. |
|
| 34 | - echo '<div class="wpinv_email_cart_item_title">' . esc_html( $item->get_name() ) . '</div>'; |
|
| 33 | + // Display the name. |
|
| 34 | + echo '<div class="wpinv_email_cart_item_title">' . esc_html( $item->get_name() ) . '</div>'; |
|
| 35 | 35 | |
| 36 | - // And an optional description. |
|
| 37 | - $description = $item->get_description(); |
|
| 36 | + // And an optional description. |
|
| 37 | + $description = $item->get_description(); |
|
| 38 | 38 | |
| 39 | - if ( ! empty( $description ) ) { |
|
| 40 | - echo "<p class='small'>" . wp_kses_post( $description ) . "</p>"; |
|
| 41 | - } |
|
| 39 | + if ( ! empty( $description ) ) { |
|
| 40 | + echo "<p class='small'>" . wp_kses_post( $description ) . "</p>"; |
|
| 41 | + } |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - // Item price. |
|
| 45 | - if ( 'price' == $column ) { |
|
| 44 | + // Item price. |
|
| 45 | + if ( 'price' == $column ) { |
|
| 46 | 46 | |
| 47 | - // Display the item price (or recurring price if this is a renewal invoice) |
|
| 48 | - $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
|
| 49 | - wpinv_the_price( $price, $invoice->get_currency() ); |
|
| 47 | + // Display the item price (or recurring price if this is a renewal invoice) |
|
| 48 | + $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
|
| 49 | + wpinv_the_price( $price, $invoice->get_currency() ); |
|
| 50 | 50 | |
| 51 | - } |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - // Item quantity. |
|
| 54 | - if ( 'quantity' == $column ) { |
|
| 55 | - echo (float) $item->get_quantity(); |
|
| 56 | - } |
|
| 53 | + // Item quantity. |
|
| 54 | + if ( 'quantity' == $column ) { |
|
| 55 | + echo (float) $item->get_quantity(); |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - // Tax rate. |
|
| 59 | - if ( 'tax_rate' == $column ) { |
|
| 60 | - echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%'; |
|
| 61 | - } |
|
| 58 | + // Tax rate. |
|
| 59 | + if ( 'tax_rate' == $column ) { |
|
| 60 | + echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%'; |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - // Item sub total. |
|
| 64 | - if ( 'subtotal' == $column ) { |
|
| 65 | - $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total(); |
|
| 66 | - wpinv_the_price( $subtotal, $invoice->get_currency() ); |
|
| 67 | - } |
|
| 63 | + // Item sub total. |
|
| 64 | + if ( 'subtotal' == $column ) { |
|
| 65 | + $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total(); |
|
| 66 | + wpinv_the_price( $subtotal, $invoice->get_currency() ); |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - // Fires when printing a line item column. |
|
| 70 | - do_action( "getpaid_email_line_item_$column", $item, $invoice ); |
|
| 69 | + // Fires when printing a line item column. |
|
| 70 | + do_action( "getpaid_email_line_item_$column", $item, $invoice ); |
|
| 71 | 71 | |
| 72 | - ?> |
|
| 72 | + ?> |
|
| 73 | 73 | |
| 74 | 74 | </td> |
| 75 | 75 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Template that generated the processing invoice email. |
| 4 | 4 | * |
@@ -7,22 +7,22 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | + defined( 'ABSPATH' ) || exit; |
|
| 11 | 11 | |
| 12 | -// Print the email header. |
|
| 13 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 12 | + // Print the email header. |
|
| 13 | + do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 14 | 14 | |
| 15 | -// Generate the custom message body. |
|
| 16 | -echo wp_kses_post( $message_body ); |
|
| 15 | + // Generate the custom message body. |
|
| 16 | + echo wp_kses_post( $message_body ); |
|
| 17 | 17 | |
| 18 | -// Print invoice details. |
|
| 19 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 18 | + // Print invoice details. |
|
| 19 | + do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 20 | 20 | |
| 21 | -// Print invoice items. |
|
| 22 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 21 | + // Print invoice items. |
|
| 22 | + do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 23 | 23 | |
| 24 | -// Print the billing details. |
|
| 25 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 24 | + // Print the billing details. |
|
| 25 | + do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 26 | 26 | |
| 27 | -// Print the email footer. |
|
| 28 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 27 | + // Print the email footer. |
|
| 28 | + do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|