@@ -4,14 +4,14 @@ |
||
4 | 4 | <h4><?php esc_html_e('New to Event Espresso?', 'event_espresso'); ?></h4> |
5 | 5 | |
6 | 6 | <p><?php |
7 | - printf( |
|
8 | - esc_html__( |
|
9 | - 'Check out the %1$squick start guide for Event Espresso 4%2$s. It has recommendations, tips, and tutorials so you can get your project started %3$squicker%4$s.', |
|
10 | - 'event_espresso' |
|
11 | - ), |
|
12 | - '<a href="https://eventespresso.com/wiki/welcome-to-event-espresso/#event-espresso-4" target="_blank">', |
|
13 | - '</a>', |
|
14 | - '<em>', |
|
15 | - '</em>' |
|
16 | - ); ?></p> |
|
7 | + printf( |
|
8 | + esc_html__( |
|
9 | + 'Check out the %1$squick start guide for Event Espresso 4%2$s. It has recommendations, tips, and tutorials so you can get your project started %3$squicker%4$s.', |
|
10 | + 'event_espresso' |
|
11 | + ), |
|
12 | + '<a href="https://eventespresso.com/wiki/welcome-to-event-espresso/#event-espresso-4" target="_blank">', |
|
13 | + '</a>', |
|
14 | + '<em>', |
|
15 | + '</em>' |
|
16 | + ); ?></p> |
|
17 | 17 | </div> |
18 | 18 | \ No newline at end of file |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | protected function _modify_validator() |
34 | 34 | { |
35 | 35 | if ($this->_context === 'attendee') { |
36 | - $this->_valid_shortcodes_modifier[ $this->_context ]['from'] = array( |
|
36 | + $this->_valid_shortcodes_modifier[$this->_context]['from'] = array( |
|
37 | 37 | 'recipient_details', |
38 | 38 | 'email', |
39 | 39 | 'organization', |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | // excluded shortcodes |
44 | 44 | $fields = array('to', 'from', 'subject', 'content', 'newsletter_content'); |
45 | 45 | foreach ($fields as $field) { |
46 | - $this->_specific_shortcode_excludes[ $field ] = array( |
|
46 | + $this->_specific_shortcode_excludes[$field] = array( |
|
47 | 47 | '[RECIPIENT_REGISTRATION_CODE]', |
48 | 48 | '[EVENT_AUTHOR_FORMATTED_EMAIL]', |
49 | 49 | '[EVENT_AUTHOR_EMAIL]', |
@@ -11,72 +11,72 @@ |
||
11 | 11 | */ |
12 | 12 | class EE_Messages_Email_Newsletter_Validator extends EE_Messages_Validator |
13 | 13 | { |
14 | - /** |
|
15 | - * EE_Messages_Email_Newsletter_Validator constructor. |
|
16 | - * |
|
17 | - * @param array $fields |
|
18 | - * @param string $context |
|
19 | - * @throws EE_Error |
|
20 | - * @throws ReflectionException |
|
21 | - */ |
|
22 | - public function __construct($fields, $context) |
|
23 | - { |
|
24 | - $this->_m_name = 'email'; |
|
25 | - $this->_mt_name = 'newsletter'; |
|
14 | + /** |
|
15 | + * EE_Messages_Email_Newsletter_Validator constructor. |
|
16 | + * |
|
17 | + * @param array $fields |
|
18 | + * @param string $context |
|
19 | + * @throws EE_Error |
|
20 | + * @throws ReflectionException |
|
21 | + */ |
|
22 | + public function __construct($fields, $context) |
|
23 | + { |
|
24 | + $this->_m_name = 'email'; |
|
25 | + $this->_mt_name = 'newsletter'; |
|
26 | 26 | |
27 | - parent::__construct($fields, $context); |
|
28 | - } |
|
27 | + parent::__construct($fields, $context); |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * custom validator (restricting what was originally set by the messenger) |
|
32 | - */ |
|
33 | - protected function _modify_validator() |
|
34 | - { |
|
35 | - if ($this->_context === 'attendee') { |
|
36 | - $this->_valid_shortcodes_modifier[ $this->_context ]['from'] = array( |
|
37 | - 'recipient_details', |
|
38 | - 'email', |
|
39 | - 'organization', |
|
40 | - ); |
|
41 | - } |
|
30 | + /** |
|
31 | + * custom validator (restricting what was originally set by the messenger) |
|
32 | + */ |
|
33 | + protected function _modify_validator() |
|
34 | + { |
|
35 | + if ($this->_context === 'attendee') { |
|
36 | + $this->_valid_shortcodes_modifier[ $this->_context ]['from'] = array( |
|
37 | + 'recipient_details', |
|
38 | + 'email', |
|
39 | + 'organization', |
|
40 | + ); |
|
41 | + } |
|
42 | 42 | |
43 | - // excluded shortcodes |
|
44 | - $fields = array('to', 'from', 'subject', 'content', 'newsletter_content'); |
|
45 | - foreach ($fields as $field) { |
|
46 | - $this->_specific_shortcode_excludes[ $field ] = array( |
|
47 | - '[RECIPIENT_REGISTRATION_CODE]', |
|
48 | - '[EVENT_AUTHOR_FORMATTED_EMAIL]', |
|
49 | - '[EVENT_AUTHOR_EMAIL]', |
|
50 | - ); |
|
51 | - } |
|
52 | - $add_excludes = array( |
|
53 | - '[RECIPIENT_FNAME]', |
|
54 | - '[RECIPIENT_LNAME]', |
|
55 | - '[RECIPIENT_EMAIL]', |
|
56 | - '[COMPANY]', |
|
57 | - '[CO_ADD1]', |
|
58 | - '[CO_ADD2]', |
|
59 | - '[CO_CITY]', |
|
60 | - '[CO_STATE]', |
|
61 | - '[CO_ZIP]', |
|
62 | - '[CO_LOGO]', |
|
63 | - '[CO_PHONE]', |
|
64 | - '[CO_LOGO_URL]', |
|
65 | - '[CO_FACEBOOK_URL]', |
|
66 | - '[CO_TWITTER_URL]', |
|
67 | - '[CO_PINTEREST_URL]', |
|
68 | - '[CO_GOOGLE_URL]', |
|
69 | - '[CO_LINKEDIN_URL]', |
|
70 | - '[CO_INSTAGRAM_URL]', |
|
71 | - ); |
|
72 | - $this->_specific_shortcode_excludes['from'] = |
|
73 | - array_merge( |
|
74 | - $this->_specific_shortcode_excludes['from'], |
|
75 | - $add_excludes |
|
76 | - ); |
|
77 | - $this->_specific_shortcode_excludes['content'] = array_merge( |
|
78 | - $this->_specific_shortcode_excludes['content'], |
|
79 | - array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]') |
|
80 | - ); |
|
81 | - } |
|
43 | + // excluded shortcodes |
|
44 | + $fields = array('to', 'from', 'subject', 'content', 'newsletter_content'); |
|
45 | + foreach ($fields as $field) { |
|
46 | + $this->_specific_shortcode_excludes[ $field ] = array( |
|
47 | + '[RECIPIENT_REGISTRATION_CODE]', |
|
48 | + '[EVENT_AUTHOR_FORMATTED_EMAIL]', |
|
49 | + '[EVENT_AUTHOR_EMAIL]', |
|
50 | + ); |
|
51 | + } |
|
52 | + $add_excludes = array( |
|
53 | + '[RECIPIENT_FNAME]', |
|
54 | + '[RECIPIENT_LNAME]', |
|
55 | + '[RECIPIENT_EMAIL]', |
|
56 | + '[COMPANY]', |
|
57 | + '[CO_ADD1]', |
|
58 | + '[CO_ADD2]', |
|
59 | + '[CO_CITY]', |
|
60 | + '[CO_STATE]', |
|
61 | + '[CO_ZIP]', |
|
62 | + '[CO_LOGO]', |
|
63 | + '[CO_PHONE]', |
|
64 | + '[CO_LOGO_URL]', |
|
65 | + '[CO_FACEBOOK_URL]', |
|
66 | + '[CO_TWITTER_URL]', |
|
67 | + '[CO_PINTEREST_URL]', |
|
68 | + '[CO_GOOGLE_URL]', |
|
69 | + '[CO_LINKEDIN_URL]', |
|
70 | + '[CO_INSTAGRAM_URL]', |
|
71 | + ); |
|
72 | + $this->_specific_shortcode_excludes['from'] = |
|
73 | + array_merge( |
|
74 | + $this->_specific_shortcode_excludes['from'], |
|
75 | + $add_excludes |
|
76 | + ); |
|
77 | + $this->_specific_shortcode_excludes['content'] = array_merge( |
|
78 | + $this->_specific_shortcode_excludes['content'], |
|
79 | + array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]') |
|
80 | + ); |
|
81 | + } |
|
82 | 82 | } |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | |
115 | 115 | foreach ($this->_valid_shortcodes as $context => $shortcodes) { |
116 | 116 | foreach ($shortcodes as $key => $shortcode) { |
117 | - if (! in_array($shortcode, $included_shortcodes, true)) { |
|
118 | - unset($this->_valid_shortcodes[ $context ][ $key ]); |
|
117 | + if ( ! in_array($shortcode, $included_shortcodes, true)) { |
|
118 | + unset($this->_valid_shortcodes[$context][$key]); |
|
119 | 119 | } |
120 | 120 | } |
121 | - $this->_valid_shortcodes[ $context ][] = 'newsletter'; |
|
121 | + $this->_valid_shortcodes[$context][] = 'newsletter'; |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
@@ -148,23 +148,23 @@ discard block |
||
148 | 148 | ? $details['att_obj'] |
149 | 149 | : null; |
150 | 150 | |
151 | - if (! $attendee instanceof EE_Attendee) { |
|
151 | + if ( ! $attendee instanceof EE_Attendee) { |
|
152 | 152 | continue; |
153 | 153 | } |
154 | 154 | |
155 | 155 | // set $aee from attendee object |
156 | 156 | $aee['att_obj'] = $attendee; |
157 | - $aee['reg_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['reg_objs']) |
|
158 | - ? $this->_data->attendees[ $attendee->ID() ]['reg_objs'] |
|
157 | + $aee['reg_objs'] = isset($this->_data->attendees[$attendee->ID()]['reg_objs']) |
|
158 | + ? $this->_data->attendees[$attendee->ID()]['reg_objs'] |
|
159 | 159 | : array(); |
160 | 160 | $aee['attendee_email'] = $attendee->email(); |
161 | - $aee['tkt_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['tkt_objs']) |
|
162 | - ? $this->_data->attendees[ $attendee->ID() ]['tkt_objs'] |
|
161 | + $aee['tkt_objs'] = isset($this->_data->attendees[$attendee->ID()]['tkt_objs']) |
|
162 | + ? $this->_data->attendees[$attendee->ID()]['tkt_objs'] |
|
163 | 163 | : array(); |
164 | 164 | |
165 | - if (isset($this->_data->attendees[ $attendee->ID() ]['evt_objs'])) { |
|
166 | - $aee['evt_objs'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs']; |
|
167 | - $aee['events'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs']; |
|
165 | + if (isset($this->_data->attendees[$attendee->ID()]['evt_objs'])) { |
|
166 | + $aee['evt_objs'] = $this->_data->attendees[$attendee->ID()]['evt_objs']; |
|
167 | + $aee['events'] = $this->_data->attendees[$attendee->ID()]['evt_objs']; |
|
168 | 168 | } else { |
169 | 169 | $aee['evt_objs'] = $aee['events'] = array(); |
170 | 170 | } |
@@ -199,8 +199,8 @@ discard block |
||
199 | 199 | $excluded_fields = array( |
200 | 200 | 'email' => array('cc') |
201 | 201 | ); |
202 | - return isset($excluded_fields[ $messenger_name ]) |
|
203 | - ? $excluded_fields[ $messenger_name ] |
|
202 | + return isset($excluded_fields[$messenger_name]) |
|
203 | + ? $excluded_fields[$messenger_name] |
|
204 | 204 | : parent::excludedFieldsForMessenger($messenger_name); |
205 | 205 | } |
206 | 206 | } |
@@ -12,194 +12,194 @@ |
||
12 | 12 | */ |
13 | 13 | class EE_Newsletter_message_type extends EE_message_type |
14 | 14 | { |
15 | - public function __construct() |
|
16 | - { |
|
17 | - $this->name = 'newsletter'; |
|
18 | - $this->description = esc_html__( |
|
19 | - 'Batch message type messages are triggered manually by the admin for sending notifications to a selected group of recipients. This should only be used for more general notification type messages that contain information specific for the recipients. For "newsletter" type messages we recommend using an email list service like MailChimp, because sending non-related mail-outs to contacts increases the risk of your site domain getting added to spam lists, which will prevent messages getting to users.', |
|
20 | - 'event_espresso' |
|
21 | - ); |
|
22 | - $this->label = array( |
|
23 | - 'singular' => esc_html__('batch', 'event_espresso'), |
|
24 | - 'plural' => esc_html__('batches', 'event_espresso'), |
|
25 | - ); |
|
26 | - $this->_master_templates = array( |
|
27 | - 'email' => 'registration', |
|
28 | - ); |
|
29 | - |
|
30 | - parent::__construct(); |
|
31 | - } |
|
32 | - |
|
33 | - |
|
34 | - /** |
|
35 | - * Sets admin_registered_pages property |
|
36 | - */ |
|
37 | - protected function _set_admin_pages() |
|
38 | - { |
|
39 | - $this->admin_registered_pages = array(); // no admin pages to register this with. |
|
40 | - } |
|
41 | - |
|
42 | - |
|
43 | - /** |
|
44 | - * Sets property related to data handler. |
|
45 | - */ |
|
46 | - protected function _set_data_handler() |
|
47 | - { |
|
48 | - $this->_data_handler = 'Registrations'; |
|
49 | - $this->_single_message = $this->_data instanceof EE_Registration; |
|
50 | - } |
|
51 | - |
|
52 | - |
|
53 | - /** |
|
54 | - * Returns the data for the given context for this message type. |
|
55 | - * @param string $context |
|
56 | - * @param EE_Registration $registration |
|
57 | - * @param int $id |
|
58 | - * @return array|mixed |
|
59 | - */ |
|
60 | - protected function _get_data_for_context($context, EE_Registration $registration, $id) |
|
61 | - { |
|
62 | - // newsletter message type data handler is 'Registrations' and it expects an array of EE_Registration objects. |
|
63 | - return array($registration); |
|
64 | - } |
|
65 | - |
|
66 | - |
|
67 | - /** |
|
68 | - * Sets the admin settings fields property for this message type. |
|
69 | - */ |
|
70 | - protected function _set_admin_settings_fields() |
|
71 | - { |
|
72 | - $this->_admin_settings_fields = array(); |
|
73 | - } |
|
74 | - |
|
75 | - |
|
76 | - /** |
|
77 | - * Sets the contexts for this message type. |
|
78 | - */ |
|
79 | - protected function _set_contexts() |
|
80 | - { |
|
81 | - $this->_context_label = array( |
|
82 | - 'label' => esc_html__('recipient', 'event_espresso'), |
|
83 | - 'plural' => esc_html__('recipients', 'event_espresso'), |
|
84 | - 'description' => esc_html__('Recipient\'s are who will receive the message.', 'event_espresso'), |
|
85 | - ); |
|
86 | - |
|
87 | - $this->_contexts = array( |
|
88 | - 'attendee' => array( |
|
89 | - 'label' => esc_html__('Registrant', 'event_espresso'), |
|
90 | - 'description' => esc_html__('This template goes to selected registrants.', 'event_espresso'), |
|
91 | - ), |
|
92 | - ); |
|
93 | - } |
|
94 | - |
|
95 | - |
|
96 | - /** |
|
97 | - * used to set the valid shortcodes. |
|
98 | - * For the newsletter message type we only have two valid shortcode libraries in use, recipient details and |
|
99 | - * organization. That's it! |
|
100 | - * |
|
101 | - * @since 4.3.0 |
|
102 | - * @return void |
|
103 | - */ |
|
104 | - protected function _set_valid_shortcodes() |
|
105 | - { |
|
106 | - parent::_set_valid_shortcodes(); |
|
107 | - |
|
108 | - $included_shortcodes = array( |
|
109 | - 'recipient_details', |
|
110 | - 'organization', |
|
111 | - 'newsletter', |
|
112 | - ); |
|
113 | - |
|
114 | - foreach ($this->_valid_shortcodes as $context => $shortcodes) { |
|
115 | - foreach ($shortcodes as $key => $shortcode) { |
|
116 | - if (! in_array($shortcode, $included_shortcodes, true)) { |
|
117 | - unset($this->_valid_shortcodes[ $context ][ $key ]); |
|
118 | - } |
|
119 | - } |
|
120 | - $this->_valid_shortcodes[ $context ][] = 'newsletter'; |
|
121 | - } |
|
122 | - } |
|
123 | - |
|
124 | - |
|
125 | - /** |
|
126 | - * Override default _attendee_addressees in EE_message_type because we want to loop through the registrations |
|
127 | - * for EE_message_type. |
|
128 | - * |
|
129 | - * @return array |
|
130 | - * @throws EE_Error |
|
131 | - * @throws InvalidArgumentException |
|
132 | - * @throws ReflectionException |
|
133 | - * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
|
134 | - * @throws \EventEspresso\core\exceptions\InvalidInterfaceException |
|
135 | - */ |
|
136 | - protected function _attendee_addressees() |
|
137 | - { |
|
138 | - $addressee = array(); |
|
139 | - |
|
140 | - // looping through registrations |
|
141 | - foreach ($this->_data->registrations as $reg_id => $details) { |
|
142 | - // set $attendee array to blank on each loop |
|
143 | - $aee = array(); |
|
144 | - |
|
145 | - // need to get the attendee from this registration. |
|
146 | - $attendee = isset($details['att_obj']) && $details['att_obj'] instanceof EE_Attendee |
|
147 | - ? $details['att_obj'] |
|
148 | - : null; |
|
149 | - |
|
150 | - if (! $attendee instanceof EE_Attendee) { |
|
151 | - continue; |
|
152 | - } |
|
153 | - |
|
154 | - // set $aee from attendee object |
|
155 | - $aee['att_obj'] = $attendee; |
|
156 | - $aee['reg_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['reg_objs']) |
|
157 | - ? $this->_data->attendees[ $attendee->ID() ]['reg_objs'] |
|
158 | - : array(); |
|
159 | - $aee['attendee_email'] = $attendee->email(); |
|
160 | - $aee['tkt_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['tkt_objs']) |
|
161 | - ? $this->_data->attendees[ $attendee->ID() ]['tkt_objs'] |
|
162 | - : array(); |
|
163 | - |
|
164 | - if (isset($this->_data->attendees[ $attendee->ID() ]['evt_objs'])) { |
|
165 | - $aee['evt_objs'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs']; |
|
166 | - $aee['events'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs']; |
|
167 | - } else { |
|
168 | - $aee['evt_objs'] = $aee['events'] = array(); |
|
169 | - } |
|
170 | - |
|
171 | - $aee['reg_obj'] = isset($details['reg_obj']) |
|
172 | - ? $details['reg_obj'] |
|
173 | - : null; |
|
174 | - $aee['attendees'] = $this->_data->attendees; |
|
175 | - |
|
176 | - // merge in the primary attendee data |
|
177 | - $aee = array_merge($this->_default_addressee_data, $aee); |
|
178 | - |
|
179 | - // make sure txn is set |
|
180 | - if (empty($aee['txn']) && $aee['reg_obj'] instanceof EE_Registration) { |
|
181 | - $aee['txn'] = $aee['reg_obj']->transaction(); |
|
182 | - } |
|
183 | - |
|
184 | - $addressee[] = new EE_Messages_Addressee($aee); |
|
185 | - } |
|
186 | - return $addressee; |
|
187 | - } |
|
188 | - |
|
189 | - /** |
|
190 | - * Allows a message type to specifically exclude template fields for the provided messenger. |
|
191 | - * Filtered so this can be programmatically altered as well. |
|
192 | - * |
|
193 | - * @param string $messenger_name name of messenger |
|
194 | - * @return array |
|
195 | - */ |
|
196 | - public function excludedFieldsForMessenger($messenger_name) |
|
197 | - { |
|
198 | - $excluded_fields = array( |
|
199 | - 'email' => array('cc') |
|
200 | - ); |
|
201 | - return isset($excluded_fields[ $messenger_name ]) |
|
202 | - ? $excluded_fields[ $messenger_name ] |
|
203 | - : parent::excludedFieldsForMessenger($messenger_name); |
|
204 | - } |
|
15 | + public function __construct() |
|
16 | + { |
|
17 | + $this->name = 'newsletter'; |
|
18 | + $this->description = esc_html__( |
|
19 | + 'Batch message type messages are triggered manually by the admin for sending notifications to a selected group of recipients. This should only be used for more general notification type messages that contain information specific for the recipients. For "newsletter" type messages we recommend using an email list service like MailChimp, because sending non-related mail-outs to contacts increases the risk of your site domain getting added to spam lists, which will prevent messages getting to users.', |
|
20 | + 'event_espresso' |
|
21 | + ); |
|
22 | + $this->label = array( |
|
23 | + 'singular' => esc_html__('batch', 'event_espresso'), |
|
24 | + 'plural' => esc_html__('batches', 'event_espresso'), |
|
25 | + ); |
|
26 | + $this->_master_templates = array( |
|
27 | + 'email' => 'registration', |
|
28 | + ); |
|
29 | + |
|
30 | + parent::__construct(); |
|
31 | + } |
|
32 | + |
|
33 | + |
|
34 | + /** |
|
35 | + * Sets admin_registered_pages property |
|
36 | + */ |
|
37 | + protected function _set_admin_pages() |
|
38 | + { |
|
39 | + $this->admin_registered_pages = array(); // no admin pages to register this with. |
|
40 | + } |
|
41 | + |
|
42 | + |
|
43 | + /** |
|
44 | + * Sets property related to data handler. |
|
45 | + */ |
|
46 | + protected function _set_data_handler() |
|
47 | + { |
|
48 | + $this->_data_handler = 'Registrations'; |
|
49 | + $this->_single_message = $this->_data instanceof EE_Registration; |
|
50 | + } |
|
51 | + |
|
52 | + |
|
53 | + /** |
|
54 | + * Returns the data for the given context for this message type. |
|
55 | + * @param string $context |
|
56 | + * @param EE_Registration $registration |
|
57 | + * @param int $id |
|
58 | + * @return array|mixed |
|
59 | + */ |
|
60 | + protected function _get_data_for_context($context, EE_Registration $registration, $id) |
|
61 | + { |
|
62 | + // newsletter message type data handler is 'Registrations' and it expects an array of EE_Registration objects. |
|
63 | + return array($registration); |
|
64 | + } |
|
65 | + |
|
66 | + |
|
67 | + /** |
|
68 | + * Sets the admin settings fields property for this message type. |
|
69 | + */ |
|
70 | + protected function _set_admin_settings_fields() |
|
71 | + { |
|
72 | + $this->_admin_settings_fields = array(); |
|
73 | + } |
|
74 | + |
|
75 | + |
|
76 | + /** |
|
77 | + * Sets the contexts for this message type. |
|
78 | + */ |
|
79 | + protected function _set_contexts() |
|
80 | + { |
|
81 | + $this->_context_label = array( |
|
82 | + 'label' => esc_html__('recipient', 'event_espresso'), |
|
83 | + 'plural' => esc_html__('recipients', 'event_espresso'), |
|
84 | + 'description' => esc_html__('Recipient\'s are who will receive the message.', 'event_espresso'), |
|
85 | + ); |
|
86 | + |
|
87 | + $this->_contexts = array( |
|
88 | + 'attendee' => array( |
|
89 | + 'label' => esc_html__('Registrant', 'event_espresso'), |
|
90 | + 'description' => esc_html__('This template goes to selected registrants.', 'event_espresso'), |
|
91 | + ), |
|
92 | + ); |
|
93 | + } |
|
94 | + |
|
95 | + |
|
96 | + /** |
|
97 | + * used to set the valid shortcodes. |
|
98 | + * For the newsletter message type we only have two valid shortcode libraries in use, recipient details and |
|
99 | + * organization. That's it! |
|
100 | + * |
|
101 | + * @since 4.3.0 |
|
102 | + * @return void |
|
103 | + */ |
|
104 | + protected function _set_valid_shortcodes() |
|
105 | + { |
|
106 | + parent::_set_valid_shortcodes(); |
|
107 | + |
|
108 | + $included_shortcodes = array( |
|
109 | + 'recipient_details', |
|
110 | + 'organization', |
|
111 | + 'newsletter', |
|
112 | + ); |
|
113 | + |
|
114 | + foreach ($this->_valid_shortcodes as $context => $shortcodes) { |
|
115 | + foreach ($shortcodes as $key => $shortcode) { |
|
116 | + if (! in_array($shortcode, $included_shortcodes, true)) { |
|
117 | + unset($this->_valid_shortcodes[ $context ][ $key ]); |
|
118 | + } |
|
119 | + } |
|
120 | + $this->_valid_shortcodes[ $context ][] = 'newsletter'; |
|
121 | + } |
|
122 | + } |
|
123 | + |
|
124 | + |
|
125 | + /** |
|
126 | + * Override default _attendee_addressees in EE_message_type because we want to loop through the registrations |
|
127 | + * for EE_message_type. |
|
128 | + * |
|
129 | + * @return array |
|
130 | + * @throws EE_Error |
|
131 | + * @throws InvalidArgumentException |
|
132 | + * @throws ReflectionException |
|
133 | + * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
|
134 | + * @throws \EventEspresso\core\exceptions\InvalidInterfaceException |
|
135 | + */ |
|
136 | + protected function _attendee_addressees() |
|
137 | + { |
|
138 | + $addressee = array(); |
|
139 | + |
|
140 | + // looping through registrations |
|
141 | + foreach ($this->_data->registrations as $reg_id => $details) { |
|
142 | + // set $attendee array to blank on each loop |
|
143 | + $aee = array(); |
|
144 | + |
|
145 | + // need to get the attendee from this registration. |
|
146 | + $attendee = isset($details['att_obj']) && $details['att_obj'] instanceof EE_Attendee |
|
147 | + ? $details['att_obj'] |
|
148 | + : null; |
|
149 | + |
|
150 | + if (! $attendee instanceof EE_Attendee) { |
|
151 | + continue; |
|
152 | + } |
|
153 | + |
|
154 | + // set $aee from attendee object |
|
155 | + $aee['att_obj'] = $attendee; |
|
156 | + $aee['reg_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['reg_objs']) |
|
157 | + ? $this->_data->attendees[ $attendee->ID() ]['reg_objs'] |
|
158 | + : array(); |
|
159 | + $aee['attendee_email'] = $attendee->email(); |
|
160 | + $aee['tkt_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['tkt_objs']) |
|
161 | + ? $this->_data->attendees[ $attendee->ID() ]['tkt_objs'] |
|
162 | + : array(); |
|
163 | + |
|
164 | + if (isset($this->_data->attendees[ $attendee->ID() ]['evt_objs'])) { |
|
165 | + $aee['evt_objs'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs']; |
|
166 | + $aee['events'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs']; |
|
167 | + } else { |
|
168 | + $aee['evt_objs'] = $aee['events'] = array(); |
|
169 | + } |
|
170 | + |
|
171 | + $aee['reg_obj'] = isset($details['reg_obj']) |
|
172 | + ? $details['reg_obj'] |
|
173 | + : null; |
|
174 | + $aee['attendees'] = $this->_data->attendees; |
|
175 | + |
|
176 | + // merge in the primary attendee data |
|
177 | + $aee = array_merge($this->_default_addressee_data, $aee); |
|
178 | + |
|
179 | + // make sure txn is set |
|
180 | + if (empty($aee['txn']) && $aee['reg_obj'] instanceof EE_Registration) { |
|
181 | + $aee['txn'] = $aee['reg_obj']->transaction(); |
|
182 | + } |
|
183 | + |
|
184 | + $addressee[] = new EE_Messages_Addressee($aee); |
|
185 | + } |
|
186 | + return $addressee; |
|
187 | + } |
|
188 | + |
|
189 | + /** |
|
190 | + * Allows a message type to specifically exclude template fields for the provided messenger. |
|
191 | + * Filtered so this can be programmatically altered as well. |
|
192 | + * |
|
193 | + * @param string $messenger_name name of messenger |
|
194 | + * @return array |
|
195 | + */ |
|
196 | + public function excludedFieldsForMessenger($messenger_name) |
|
197 | + { |
|
198 | + $excluded_fields = array( |
|
199 | + 'email' => array('cc') |
|
200 | + ); |
|
201 | + return isset($excluded_fields[ $messenger_name ]) |
|
202 | + ? $excluded_fields[ $messenger_name ] |
|
203 | + : parent::excludedFieldsForMessenger($messenger_name); |
|
204 | + } |
|
205 | 205 | } |
@@ -67,8 +67,8 @@ |
||
67 | 67 | |
68 | 68 | // remove unwanted transaction shortcode |
69 | 69 | foreach ($this->_valid_shortcodes as $context => $shortcodes) { |
70 | - if (($key = array_search('transaction', $shortcodes) ) !== false) { |
|
71 | - unset($this->_valid_shortcodes[ $context ][ $key ]); |
|
70 | + if (($key = array_search('transaction', $shortcodes)) !== false) { |
|
71 | + unset($this->_valid_shortcodes[$context][$key]); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | } |
@@ -15,61 +15,61 @@ |
||
15 | 15 | class EE_Cancelled_Registration_message_type extends EE_Registration_Base_message_type |
16 | 16 | { |
17 | 17 | |
18 | - public function __construct() |
|
19 | - { |
|
20 | - $this->name = 'cancelled_registration'; |
|
21 | - $this->description = esc_html__('This message type is for messages sent to registrants when their registration is cancelled.', 'event_espresso'); |
|
22 | - $this->label = array( |
|
23 | - 'singular' => esc_html__('registration cancelled', 'event_espresso'), |
|
24 | - 'plural' => esc_html__('registrations cancelled', 'event_espresso') |
|
25 | - ); |
|
26 | - $this->_master_templates = array( |
|
27 | - 'email' => 'not_approved_registration' |
|
28 | - ); |
|
29 | - parent::__construct(); |
|
30 | - } |
|
18 | + public function __construct() |
|
19 | + { |
|
20 | + $this->name = 'cancelled_registration'; |
|
21 | + $this->description = esc_html__('This message type is for messages sent to registrants when their registration is cancelled.', 'event_espresso'); |
|
22 | + $this->label = array( |
|
23 | + 'singular' => esc_html__('registration cancelled', 'event_espresso'), |
|
24 | + 'plural' => esc_html__('registrations cancelled', 'event_espresso') |
|
25 | + ); |
|
26 | + $this->_master_templates = array( |
|
27 | + 'email' => 'not_approved_registration' |
|
28 | + ); |
|
29 | + parent::__construct(); |
|
30 | + } |
|
31 | 31 | |
32 | 32 | |
33 | 33 | |
34 | 34 | |
35 | - /** |
|
36 | - * _set_contexts |
|
37 | - * This sets up the contexts associated with the message_type |
|
38 | - * |
|
39 | - * @access protected |
|
40 | - * @return void |
|
41 | - */ |
|
42 | - protected function _set_contexts() |
|
43 | - { |
|
44 | - $this->_context_label = array( |
|
45 | - 'label' => esc_html__('recipient', 'event_espresso'), |
|
46 | - 'plural' => esc_html__('recipients', 'event_espresso'), |
|
47 | - 'description' => esc_html__('Recipient\'s are who will receive the template. You may want different registration details sent out depending on who the recipient is', 'event_espresso') |
|
48 | - ); |
|
35 | + /** |
|
36 | + * _set_contexts |
|
37 | + * This sets up the contexts associated with the message_type |
|
38 | + * |
|
39 | + * @access protected |
|
40 | + * @return void |
|
41 | + */ |
|
42 | + protected function _set_contexts() |
|
43 | + { |
|
44 | + $this->_context_label = array( |
|
45 | + 'label' => esc_html__('recipient', 'event_espresso'), |
|
46 | + 'plural' => esc_html__('recipients', 'event_espresso'), |
|
47 | + 'description' => esc_html__('Recipient\'s are who will receive the template. You may want different registration details sent out depending on who the recipient is', 'event_espresso') |
|
48 | + ); |
|
49 | 49 | |
50 | - $this->_contexts = array( |
|
51 | - 'admin' => array( |
|
52 | - 'label' => esc_html__('Event Admin', 'event_espresso'), |
|
53 | - 'description' => esc_html__('This template is what event administrators will receive with an cancelled registration', 'event_espresso') |
|
54 | - ), |
|
55 | - 'attendee' => array( |
|
56 | - 'label' => esc_html__('Registrant', 'event_espresso'), |
|
57 | - 'description' => esc_html__('This template is what each registrant for the event will receive when their registration is cancelled.', 'event_espresso') |
|
58 | - ) |
|
59 | - ); |
|
60 | - } |
|
50 | + $this->_contexts = array( |
|
51 | + 'admin' => array( |
|
52 | + 'label' => esc_html__('Event Admin', 'event_espresso'), |
|
53 | + 'description' => esc_html__('This template is what event administrators will receive with an cancelled registration', 'event_espresso') |
|
54 | + ), |
|
55 | + 'attendee' => array( |
|
56 | + 'label' => esc_html__('Registrant', 'event_espresso'), |
|
57 | + 'description' => esc_html__('This template is what each registrant for the event will receive when their registration is cancelled.', 'event_espresso') |
|
58 | + ) |
|
59 | + ); |
|
60 | + } |
|
61 | 61 | |
62 | 62 | |
63 | 63 | |
64 | - protected function _set_valid_shortcodes() |
|
65 | - { |
|
66 | - parent::_set_valid_shortcodes(); |
|
64 | + protected function _set_valid_shortcodes() |
|
65 | + { |
|
66 | + parent::_set_valid_shortcodes(); |
|
67 | 67 | |
68 | - // remove unwanted transaction shortcode |
|
69 | - foreach ($this->_valid_shortcodes as $context => $shortcodes) { |
|
70 | - if (($key = array_search('transaction', $shortcodes) ) !== false) { |
|
71 | - unset($this->_valid_shortcodes[ $context ][ $key ]); |
|
72 | - } |
|
73 | - } |
|
74 | - } |
|
68 | + // remove unwanted transaction shortcode |
|
69 | + foreach ($this->_valid_shortcodes as $context => $shortcodes) { |
|
70 | + if (($key = array_search('transaction', $shortcodes) ) !== false) { |
|
71 | + unset($this->_valid_shortcodes[ $context ][ $key ]); |
|
72 | + } |
|
73 | + } |
|
74 | + } |
|
75 | 75 | } |
@@ -32,18 +32,18 @@ |
||
32 | 32 | |
33 | 33 | // modify just event_list |
34 | 34 | $new_config['event_list'] = array( |
35 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
35 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | 36 | ); |
37 | 37 | $new_config['ticket_list'] = array( |
38 | 38 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
39 | 39 | ); |
40 | 40 | $new_config['content'] = array( |
41 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
41 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | 42 | ); |
43 | 43 | $this->_messenger->set_validator_config($new_config); |
44 | 44 | |
45 | 45 | if ($this->_context != 'admin') { |
46 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
46 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -13,37 +13,37 @@ |
||
13 | 13 | */ |
14 | 14 | class EE_Messages_Email_Payment_Reminder_Validator extends EE_Messages_Validator |
15 | 15 | { |
16 | - public function __construct($fields, $context) |
|
17 | - { |
|
18 | - $this->_m_name = 'email'; |
|
19 | - $this->_mt_name = 'payment_reminder'; |
|
16 | + public function __construct($fields, $context) |
|
17 | + { |
|
18 | + $this->_m_name = 'email'; |
|
19 | + $this->_mt_name = 'payment_reminder'; |
|
20 | 20 | |
21 | - parent::__construct($fields, $context); |
|
22 | - } |
|
21 | + parent::__construct($fields, $context); |
|
22 | + } |
|
23 | 23 | |
24 | - /** |
|
25 | - * at this point no custom validation needed for this messenger/message_type combo. |
|
26 | - */ |
|
27 | - protected function _modify_validator() |
|
28 | - { |
|
29 | - $new_config = $this->_messenger->get_validator_config(); |
|
24 | + /** |
|
25 | + * at this point no custom validation needed for this messenger/message_type combo. |
|
26 | + */ |
|
27 | + protected function _modify_validator() |
|
28 | + { |
|
29 | + $new_config = $this->_messenger->get_validator_config(); |
|
30 | 30 | |
31 | - // modify just event_list |
|
32 | - $new_config['event_list'] = array( |
|
33 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
34 | - ); |
|
35 | - $new_config['ticket_list'] = array( |
|
36 | - 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
37 | - ); |
|
38 | - $new_config['content'] = array( |
|
39 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
40 | - ); |
|
41 | - $this->_messenger->set_validator_config($new_config); |
|
31 | + // modify just event_list |
|
32 | + $new_config['event_list'] = array( |
|
33 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
34 | + ); |
|
35 | + $new_config['ticket_list'] = array( |
|
36 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
37 | + ); |
|
38 | + $new_config['content'] = array( |
|
39 | + 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
40 | + ); |
|
41 | + $this->_messenger->set_validator_config($new_config); |
|
42 | 42 | |
43 | - if ($this->_context != 'admin') { |
|
44 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
45 | - } |
|
43 | + if ($this->_context != 'admin') { |
|
44 | + $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
45 | + } |
|
46 | 46 | |
47 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
48 | - } |
|
47 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
48 | + } |
|
49 | 49 | } |
@@ -32,18 +32,18 @@ |
||
32 | 32 | |
33 | 33 | // modify just event_list |
34 | 34 | $new_config['event_list'] = array( |
35 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
35 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | 36 | ); |
37 | 37 | $new_config['ticket_list'] = array( |
38 | 38 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
39 | 39 | ); |
40 | 40 | $new_config['content'] = array( |
41 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
41 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | 42 | ); |
43 | 43 | $this->_messenger->set_validator_config($new_config); |
44 | 44 | |
45 | 45 | if ($this->_context != 'admin') { |
46 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
46 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -13,37 +13,37 @@ |
||
13 | 13 | */ |
14 | 14 | class EE_Messages_Email_Payment_Declined_Validator extends EE_Messages_Validator |
15 | 15 | { |
16 | - public function __construct($fields, $context) |
|
17 | - { |
|
18 | - $this->_m_name = 'email'; |
|
19 | - $this->_mt_name = 'payment_declined'; |
|
16 | + public function __construct($fields, $context) |
|
17 | + { |
|
18 | + $this->_m_name = 'email'; |
|
19 | + $this->_mt_name = 'payment_declined'; |
|
20 | 20 | |
21 | - parent::__construct($fields, $context); |
|
22 | - } |
|
21 | + parent::__construct($fields, $context); |
|
22 | + } |
|
23 | 23 | |
24 | - /** |
|
25 | - * at this point no custom validation needed for this messenger/message_type combo. |
|
26 | - */ |
|
27 | - protected function _modify_validator() |
|
28 | - { |
|
29 | - $new_config = $this->_messenger->get_validator_config(); |
|
24 | + /** |
|
25 | + * at this point no custom validation needed for this messenger/message_type combo. |
|
26 | + */ |
|
27 | + protected function _modify_validator() |
|
28 | + { |
|
29 | + $new_config = $this->_messenger->get_validator_config(); |
|
30 | 30 | |
31 | - // modify just event_list |
|
32 | - $new_config['event_list'] = array( |
|
33 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
34 | - ); |
|
35 | - $new_config['ticket_list'] = array( |
|
36 | - 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
37 | - ); |
|
38 | - $new_config['content'] = array( |
|
39 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
40 | - ); |
|
41 | - $this->_messenger->set_validator_config($new_config); |
|
31 | + // modify just event_list |
|
32 | + $new_config['event_list'] = array( |
|
33 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
34 | + ); |
|
35 | + $new_config['ticket_list'] = array( |
|
36 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
37 | + ); |
|
38 | + $new_config['content'] = array( |
|
39 | + 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
40 | + ); |
|
41 | + $this->_messenger->set_validator_config($new_config); |
|
42 | 42 | |
43 | - if ($this->_context != 'admin') { |
|
44 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
45 | - } |
|
43 | + if ($this->_context != 'admin') { |
|
44 | + $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
45 | + } |
|
46 | 46 | |
47 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
48 | - } |
|
47 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
48 | + } |
|
49 | 49 | } |
@@ -32,18 +32,18 @@ |
||
32 | 32 | |
33 | 33 | // modify just event_list |
34 | 34 | $new_config['event_list'] = array( |
35 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
35 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | 36 | ); |
37 | 37 | $new_config['ticket_list'] = array( |
38 | 38 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
39 | 39 | ); |
40 | 40 | $new_config['content'] = array( |
41 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
41 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | 42 | ); |
43 | 43 | $this->_messenger->set_validator_config($new_config); |
44 | 44 | |
45 | 45 | if ($this->_context != 'admin') { |
46 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
46 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -14,37 +14,37 @@ |
||
14 | 14 | */ |
15 | 15 | class EE_Messages_Email_Payment_Cancelled_Validator extends EE_Messages_Validator |
16 | 16 | { |
17 | - public function __construct($fields, $context) |
|
18 | - { |
|
19 | - $this->_m_name = 'email'; |
|
20 | - $this->_mt_name = 'payment_cancelled'; |
|
17 | + public function __construct($fields, $context) |
|
18 | + { |
|
19 | + $this->_m_name = 'email'; |
|
20 | + $this->_mt_name = 'payment_cancelled'; |
|
21 | 21 | |
22 | - parent::__construct($fields, $context); |
|
23 | - } |
|
22 | + parent::__construct($fields, $context); |
|
23 | + } |
|
24 | 24 | |
25 | - /** |
|
26 | - * at this point no custom validation needed for this messenger/message_type combo. |
|
27 | - */ |
|
28 | - protected function _modify_validator() |
|
29 | - { |
|
30 | - $new_config = $this->_messenger->get_validator_config(); |
|
25 | + /** |
|
26 | + * at this point no custom validation needed for this messenger/message_type combo. |
|
27 | + */ |
|
28 | + protected function _modify_validator() |
|
29 | + { |
|
30 | + $new_config = $this->_messenger->get_validator_config(); |
|
31 | 31 | |
32 | - // modify just event_list |
|
33 | - $new_config['event_list'] = array( |
|
34 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
35 | - ); |
|
36 | - $new_config['ticket_list'] = array( |
|
37 | - 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
38 | - ); |
|
39 | - $new_config['content'] = array( |
|
40 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
41 | - ); |
|
42 | - $this->_messenger->set_validator_config($new_config); |
|
32 | + // modify just event_list |
|
33 | + $new_config['event_list'] = array( |
|
34 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
35 | + ); |
|
36 | + $new_config['ticket_list'] = array( |
|
37 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
38 | + ); |
|
39 | + $new_config['content'] = array( |
|
40 | + 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
41 | + ); |
|
42 | + $this->_messenger->set_validator_config($new_config); |
|
43 | 43 | |
44 | - if ($this->_context != 'admin') { |
|
45 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
46 | - } |
|
44 | + if ($this->_context != 'admin') { |
|
45 | + $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
46 | + } |
|
47 | 47 | |
48 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
49 | - } |
|
48 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
49 | + } |
|
50 | 50 | } |
@@ -32,18 +32,18 @@ |
||
32 | 32 | |
33 | 33 | // modify just event_list |
34 | 34 | $new_config['event_list'] = array( |
35 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
35 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
36 | 36 | ); |
37 | 37 | $new_config['ticket_list'] = array( |
38 | 38 | 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
39 | 39 | ); |
40 | 40 | $new_config['content'] = array( |
41 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
41 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
42 | 42 | ); |
43 | 43 | $this->_messenger->set_validator_config($new_config); |
44 | 44 | |
45 | 45 | if ($this->_context != 'admin') { |
46 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
46 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -14,37 +14,37 @@ |
||
14 | 14 | */ |
15 | 15 | class EE_Messages_Email_Payment_Failed_Validator extends EE_Messages_Validator |
16 | 16 | { |
17 | - public function __construct($fields, $context) |
|
18 | - { |
|
19 | - $this->_m_name = 'email'; |
|
20 | - $this->_mt_name = 'payment_failed'; |
|
17 | + public function __construct($fields, $context) |
|
18 | + { |
|
19 | + $this->_m_name = 'email'; |
|
20 | + $this->_mt_name = 'payment_failed'; |
|
21 | 21 | |
22 | - parent::__construct($fields, $context); |
|
23 | - } |
|
22 | + parent::__construct($fields, $context); |
|
23 | + } |
|
24 | 24 | |
25 | - /** |
|
26 | - * at this point no custom validation needed for this messenger/message_type combo. |
|
27 | - */ |
|
28 | - protected function _modify_validator() |
|
29 | - { |
|
30 | - $new_config = $this->_messenger->get_validator_config(); |
|
25 | + /** |
|
26 | + * at this point no custom validation needed for this messenger/message_type combo. |
|
27 | + */ |
|
28 | + protected function _modify_validator() |
|
29 | + { |
|
30 | + $new_config = $this->_messenger->get_validator_config(); |
|
31 | 31 | |
32 | - // modify just event_list |
|
33 | - $new_config['event_list'] = array( |
|
34 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
35 | - ); |
|
36 | - $new_config['ticket_list'] = array( |
|
37 | - 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
38 | - ); |
|
39 | - $new_config['content'] = array( |
|
40 | - 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
41 | - ); |
|
42 | - $this->_messenger->set_validator_config($new_config); |
|
32 | + // modify just event_list |
|
33 | + $new_config['event_list'] = array( |
|
34 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list') |
|
35 | + ); |
|
36 | + $new_config['ticket_list'] = array( |
|
37 | + 'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction') |
|
38 | + ); |
|
39 | + $new_config['content'] = array( |
|
40 | + 'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger') |
|
41 | + ); |
|
42 | + $this->_messenger->set_validator_config($new_config); |
|
43 | 43 | |
44 | - if ($this->_context != 'admin') { |
|
45 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
46 | - } |
|
44 | + if ($this->_context != 'admin') { |
|
45 | + $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
46 | + } |
|
47 | 47 | |
48 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
49 | - } |
|
48 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
49 | + } |
|
50 | 50 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $this->_messenger->set_validator_config($new_config); |
39 | 39 | |
40 | 40 | if ($this->_context != 'admin') { |
41 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
41 | + $this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
@@ -13,30 +13,30 @@ |
||
13 | 13 | */ |
14 | 14 | class EE_Messages_Email_Cancelled_Registration_Validator extends EE_Messages_Validator |
15 | 15 | { |
16 | - public function __construct($fields, $context) |
|
17 | - { |
|
18 | - $this->_m_name = 'email'; |
|
19 | - $this->_mt_name = 'cancelled_registration'; |
|
16 | + public function __construct($fields, $context) |
|
17 | + { |
|
18 | + $this->_m_name = 'email'; |
|
19 | + $this->_mt_name = 'cancelled_registration'; |
|
20 | 20 | |
21 | - parent::__construct($fields, $context); |
|
22 | - } |
|
21 | + parent::__construct($fields, $context); |
|
22 | + } |
|
23 | 23 | |
24 | - /** |
|
25 | - * custom validator (will override what was originally set by the message_type and messenger) |
|
26 | - */ |
|
27 | - protected function _modify_validator() |
|
28 | - { |
|
29 | - $new_config = $this->_messenger->get_validator_config(); |
|
30 | - $new_config['event_list'] = array( |
|
31 | - 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
32 | - 'required' => array('[EVENT_LIST]') |
|
33 | - ); |
|
34 | - $this->_messenger->set_validator_config($new_config); |
|
24 | + /** |
|
25 | + * custom validator (will override what was originally set by the message_type and messenger) |
|
26 | + */ |
|
27 | + protected function _modify_validator() |
|
28 | + { |
|
29 | + $new_config = $this->_messenger->get_validator_config(); |
|
30 | + $new_config['event_list'] = array( |
|
31 | + 'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'), |
|
32 | + 'required' => array('[EVENT_LIST]') |
|
33 | + ); |
|
34 | + $this->_messenger->set_validator_config($new_config); |
|
35 | 35 | |
36 | - if ($this->_context != 'admin') { |
|
37 | - $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
38 | - } |
|
36 | + if ($this->_context != 'admin') { |
|
37 | + $this->_valid_shortcodes_modifier[ $this->_context ]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'); |
|
38 | + } |
|
39 | 39 | |
40 | - $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
41 | - } |
|
40 | + $this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]'); |
|
41 | + } |
|
42 | 42 | } |