Changeset 25550 for trunk/include/functions_mail.inc.php
- Timestamp:
- Nov 18, 2013, 6:36:35 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_mail.inc.php
r25384 r25550 23 23 24 24 /** 25 * @package functions\mail 26 */ 27 28 29 /** 25 30 * Returns the name of the mail sender 31 * 26 32 * @return string 27 33 */ … … 35 41 /** 36 42 * Returns the email of the mail sender 43 * 37 44 * @since 2.6 38 45 * @return string … … 46 53 47 54 /** 48 * Returns an array of mail configuration parameters :55 * Returns an array of mail configuration parameters. 49 56 * - send_bcc_mail_webmaster 50 57 * - mail_allow_html … … 80 87 81 88 /** 82 * Returns an email address with an associated real name 83 * @param string name 84 * @param string email 89 * Returns an email address with an associated real name. 90 * Can return either: 91 * - email@domain.com 92 * - name <email@domain.com> 93 * 94 * @param string $name 95 * @param string $email 96 * @return string 85 97 */ 86 98 function format_email($name, $email) … … 105 117 106 118 /** 107 * Returns the mail and the name from a formatted address119 * Returns the email and the name from a formatted address. 108 120 * @since 2.6 109 * @param string|array $input 110 * @return array 121 * 122 * @param string|string[] $input - if is an array must contain email[, name] 123 * @return array email, name 111 124 */ 112 125 function unformat_email($input) … … 138 151 139 152 /** 140 * Return a clean array of hashmaps (email, name) from various inputs 141 * - comma separated list 142 * - array of emails 143 * - single hashmap (email[, name]) 153 * Return a clean array of hashmaps (email, name) removing duplicates. 154 * It accepts various inputs: 155 * - comma separated list 156 * - array of emails 157 * - single hashmap (email[, name]) 158 * - array of incomplete hashmaps 144 159 * @since 2.6 145 160 * … … 164 179 { 165 180 $item = array( 166 'email' => $item,181 'email' => trim($item), 167 182 'name' => '', 168 183 ); … … 185 200 $data = array_map('unformat_email', $data); 186 201 } 187 188 return $data; 189 } 190 191 /** 192 * Returns an email address list with minimal email string 202 203 $existing = array(); 204 foreach ($data as $i => $entry) 205 { 206 if (isset($existing[ $entry['email'] ]) 207 { 208 unset($data[$i]); 209 } 210 else 211 { 212 $existing[ $entry['email'] ] = true; 213 } 214 } 215 216 return array_values($data); 217 } 218 219 /** 220 * Returns an email address list with minimal email string. 221 * @deprecated 2.6 222 * 193 223 * @param string $email_list - comma separated 194 224 * @return string … … 212 242 213 243 /** 214 * Return an new mail template 244 * Return an new mail template. 245 * 215 246 * @param string $email_format - text/html or text/plain 216 247 * @return Template … … 223 254 224 255 /** 225 * Return string email format (text/html or text/plain) 226 * @param bool is_html 256 * Return string email format (text/html or text/plain). 257 * 258 * @param bool $is_html 227 259 * @return string 228 260 */ … … 233 265 234 266 /** 235 * Switch language to specified language 267 * Switch language to specified language. 236 268 * All entries are push on language stack 269 * 237 270 * @param string $language 238 271 */ … … 296 329 297 330 /** 298 * Switch back language pushed with switch_lang_to function 331 * Switch back language pushed with switch_lang_to() function. 332 * @see switch_lang_to() 299 333 */ 300 334 function switch_lang_back() … … 318 352 319 353 /** 320 * Send a notification email to all administrators 354 * Send a notification email to all administrators. 321 355 * current user (if admin) is not notified 356 * 322 357 * @param string|array $subject 323 358 * @param string|array $content … … 376 411 377 412 /** 378 * Send a email to all administrators 413 * Send a email to all administrators. 379 414 * current user (if admin) is excluded 380 415 * @see pwg_mail() … … 425 460 426 461 /** 427 * Send an email to a group 462 * Send an email to a group. 428 463 * @see pwg_mail() 429 464 * 430 465 * @param int $group_id 431 466 * @param array $args - as in pwg_mail() 432 * @option string language_selected - filters users of the group by language467 * o language_selected: filters users of the group by language [default value empty] 433 468 * @param array $tpl - as in pwg_mail() 434 469 * @return boolean … … 509 544 510 545 /** 511 * sends an email, using Piwigo specific informations512 * 513 * @param string| string[]$to546 * Sends an email, using Piwigo specific informations. 547 * 548 * @param string|array $to 514 549 * @param array $args 515 550 * o from: sender [default value webmaster email] … … 594 629 if ($conf_mail['send_bcc_mail_webmaster']) 595 630 { 596 $Bcc[] = get_webmaster_mail_address(); 631 $Bcc[] = array( 632 'email' => get_webmaster_mail_address(), 633 'name' => '', 634 ); 597 635 } 598 636 if (!empty($Bcc)) … … 822 860 { 823 861 $ret = $mail->send(); 824 if (!$ret and (!ini_get('display_errors') ||is_admin()))862 if (!$ret and (!ini_get('display_errors') or is_admin())) 825 863 { 826 864 trigger_error('Mailer Error: ' . $mail->ErrorInfo, E_USER_WARNING); … … 859 897 860 898 /** 861 * Moves CSS rules contained in the <style> tag to inline CSS 862 * (for compatibility with Gmail and such clients)899 * Moves CSS rules contained in the <style> tag to inline CSS. 900 * Used for compatibility with Gmail and such clients 863 901 * @since 2.6 902 * 864 903 * @param string $content 865 904 * @return string … … 875 914 876 915 /** 877 * Saves a copy of the mail if _data/tmp 878 * @param boolean $result 879 * @param string $to 916 * Saves a copy of the mail if _data/tmp. 917 * 918 * @param boolean $success 919 * @param PHPMailer $mail 880 920 * @param array $args 881 * @param PHPMailer $mail882 * @return boolean $result883 921 */ 884 922 function pwg_send_mail_test($success, $mail, $args)
Note: See TracChangeset
for help on using the changeset viewer.