abstract-email-notification.php
6 years ago
ajax-handler.php
6 years ago
backward-compatibility.php
6 years ago
class-donation-receipt-email.php
6 years ago
class-donor-note-email.php
6 years ago
class-donor-register-email.php
6 years ago
class-email-access-email.php
6 years ago
class-email-notification-table.php
6 years ago
class-email-notification-util.php
6 years ago
class-email-notifications.php
6 years ago
class-email-setting-field.php
6 years ago
class-new-donation-email.php
6 years ago
class-new-donor-register-email.php
6 years ago
class-new-offline-donation-email.php
6 years ago
class-offline-donation-instruction-email.php
6 years ago
filters.php
6 years ago
filters.php
81 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Filter for Email Notification |
| 4 | * |
| 5 | * @package Give |
| 6 | * @subpackage Classes/Emails |
| 7 | * @copyright Copyright (c) 2016, GiveWP |
| 8 | * @license https://opensource.org/licenses/gpl-license GNU Public License |
| 9 | * @since 2.0 |
| 10 | */ |
| 11 | |
| 12 | /** |
| 13 | * Add extra row actions to email notification table. |
| 14 | * |
| 15 | * @since 2.0 |
| 16 | * |
| 17 | * @param array $row_actions |
| 18 | * @param Give_Email_Notification $email |
| 19 | * |
| 20 | * @return array |
| 21 | */ |
| 22 | function give_email_notification_row_actions_callback( $row_actions, $email ) { |
| 23 | if ( Give_Email_Notification_Util::is_email_preview( $email ) ) { |
| 24 | $preview_link = sprintf( |
| 25 | '<a href="%1$s" target="_blank">%2$s</a>', |
| 26 | wp_nonce_url( |
| 27 | add_query_arg( |
| 28 | array( |
| 29 | 'give_action' => 'preview_email', |
| 30 | 'email_type' => $email->config['id'], |
| 31 | ), |
| 32 | home_url() |
| 33 | ), |
| 34 | 'give-preview-email' |
| 35 | ), |
| 36 | __( 'Preview', 'give' ) |
| 37 | ); |
| 38 | |
| 39 | $send_preview_email_link = sprintf( |
| 40 | '<a href="%1$s">%2$s</a>', |
| 41 | wp_nonce_url( |
| 42 | add_query_arg( |
| 43 | array( |
| 44 | 'give_action' => 'send_preview_email', |
| 45 | 'email_type' => $email->config['id'], |
| 46 | 'give-messages[]' => 'sent-test-email', |
| 47 | ) |
| 48 | ), |
| 49 | 'give-send-preview-email' |
| 50 | ), |
| 51 | __( 'Send test email', 'give' ) |
| 52 | ); |
| 53 | |
| 54 | $row_actions['email_preview'] = $preview_link; |
| 55 | $row_actions['send_preview_email'] = $send_preview_email_link; |
| 56 | } |
| 57 | |
| 58 | return $row_actions; |
| 59 | } |
| 60 | add_filter( 'give_email_notification_row_actions', 'give_email_notification_row_actions_callback', 10, 2 ); |
| 61 | |
| 62 | /** |
| 63 | * This help to decode all email template tags. |
| 64 | * |
| 65 | * @since 2.0 |
| 66 | * |
| 67 | * @param string $message |
| 68 | * @param Give_Emails $email_obj |
| 69 | * |
| 70 | * @return string |
| 71 | */ |
| 72 | function give_decode_email_tags( $message, $email_obj ) { |
| 73 | if ( ! empty( $email_obj->tag_args ) ) { |
| 74 | $message = give_do_email_tags( $message, $email_obj->tag_args ); |
| 75 | } |
| 76 | |
| 77 | return $message; |
| 78 | } |
| 79 | |
| 80 | add_filter( 'give_email_message', 'give_decode_email_tags', 10, 2 ); |
| 81 |