Changeset 2139 for branches/branch-1_7/admin/notification_by_mail.php
- Timestamp:
- Oct 16, 2007, 10:45:00 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/branch-1_7/admin/notification_by_mail.php
r2088 r2139 211 211 212 212 /* 213 * Apply global functions to mail content 214 * return customize mail content rendered 215 */ 216 function render_global_customize_mail_content($customize_mail_content) 217 { 218 global $conf; 219 220 if ($conf['nbm_send_html_mail'] and !(strpos($customize_mail_content, '<') === 0)) 221 { 222 // On HTML mail, detects if the content are HTML format. 223 // If it's plain text format, convert content to readable HTML 224 return nl2br(htmlspecialchars($customize_mail_content)); 225 } 226 else 227 { 228 return $customize_mail_content; 229 } 230 } 231 232 /* 213 233 * Send mail for notification to all users 214 234 * Return list of "selected" users for 'list_to_send' … … 244 264 } 245 265 246 if ($conf['nbm_send_html_mail'] and !(strpos($customize_mail_content, '<') === 0)) 247 { 248 // On HTML mail, detects if the content are HTML format. 249 // If it's plain text format, convert content to readable HTML 250 $customize_mail_content = nl2br(htmlentities($customize_mail_content)); 251 } 266 $customize_mail_content = 267 trigger_event('nbm_render_global_customize_mail_content', $customize_mail_content); 268 252 269 253 270 // Prepare message after change language … … 344 361 } 345 362 346 if (!empty($customize_mail_content)) 363 $nbm_user_customize_mail_content = 364 trigger_event('nbm_render_user_customize_mail_content', 365 $customize_mail_content, $nbm_user); 366 if (!empty($nbm_user_customize_mail_content)) 347 367 { 348 368 $env_nbm['mail_template']->assign_block_vars 349 369 ( 350 'custom', array('CUSTOMIZE_MAIL_CONTENT' => $customize_mail_content) 370 'custom', 371 array('CUSTOMIZE_MAIL_CONTENT' => 372 $nbm_user_customize_mail_content) 351 373 ); 352 374 } … … 481 503 // +-----------------------------------------------------------------------+ 482 504 check_status(get_tab_status($page['mode'])); 505 506 507 // +-----------------------------------------------------------------------+ 508 // | Add event handler | 509 // +-----------------------------------------------------------------------+ 510 add_event_handler('nbm_render_global_customize_mail_content', 'render_global_customize_mail_content'); 511 trigger_action('nbm_event_handler_added'); 512 483 513 484 514 // +-----------------------------------------------------------------------+
Note: See TracChangeset
for help on using the changeset viewer.