PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / includes / admin / emails / filters.php

filters.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at includes/admin/emails/filters.php

86 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 esc_url(
27 wp_nonce_url(
28 add_query_arg(
29 array(
30 'give_action' => 'preview_email',
31 'email_type' => $email->config['id'],
32 ),
33 home_url()
34 ),
35 'give-preview-email'
36 )
37 ),
38 __( 'Preview', 'give' )
39 );
40
41 $send_preview_email_link = give()->tooltips->render_link( [
42 'tag_content' => esc_html__( 'Send test email', 'give' ),
43 'label' => sprintf(
44 esc_html__( 'Click this link to send a test email to yourself at %s', 'give' ),
45 wp_get_current_user()->user_email
46 ),
47 'link' => esc_url_raw(wp_nonce_url(
48 add_query_arg(
49 array(
50 'give_action' => 'send_preview_email',
51 'email_type' => $email->config['id'],
52 'give-messages[]' => 'sent-test-email',
53 )
54 ),
55 'give-send-preview-email'
56 ))
57 ] );
58
59 $row_actions['email_preview'] = $preview_link;
60 $row_actions['send_preview_email'] = $send_preview_email_link;
61 }
62
63 return $row_actions;
64 }
65 add_filter( 'give_email_notification_row_actions', 'give_email_notification_row_actions_callback', 10, 2 );
66
67 /**
68 * This help to decode all email template tags.
69 *
70 * @since 2.0
71 *
72 * @param string $message
73 * @param Give_Emails $email_obj
74 *
75 * @return string
76 */
77 function give_decode_email_tags( $message, $email_obj ) {
78 if ( ! empty( $email_obj->tag_args ) ) {
79 $message = give_do_email_tags( $message, $email_obj->tag_args );
80 }
81
82 return $message;
83 }
84
85 add_filter( 'give_email_message', 'give_decode_email_tags', 10, 2 );
86