CoreAPI
[ class tree: CoreAPI ] [ index: CoreAPI ] [ all elements ]

Procedural File: email_api.php

Source Location: /core/email_api.php



Page Details:



Tags:

copyright:  Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
copyright:  Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
link:  http://www.mantisbt.org
usedby:  bug_reopen()


Includes:

require_once('current_user_api.php') [line 28]
requires current_user_api

require_once('relationship_api.php') [line 52]
requires relationship_api

require_once('history_api.php') [line 44]
requires history_api

require_once('bug_api.php') [line 32]
requires bug_api

require_once('custom_field_api.php') [line 36]
requires custom_field_api

require_once('string_api.php') [line 40]
requires string_api

require_once('email_queue_api.php') [line 48]
requires email_queue_api







email_append_domain [line 1075]

The email_append_domain( string $p_email)

Appends an email domain to the specified email address if email is not empty, it doesn't already have a domain part and if a limit_email_domain is configured.

Check limit_email_domain option and append the domain name if it is set




Tags:

return:  email address with the appended domain (if applicable).
todo:  limit_email_domain called after we look for @ in domain name?


Parameters

string   $p_email   The email address to append the domain to.
[ Top ]



email_assign [line 762]

null email_assign( int $p_bug_id)

send notices when a bug is ASSIGNED



Parameters

int   $p_bug_id  
[ Top ]



email_bugnote_add [line 726]

null email_bugnote_add( int $p_bug_id)

send notices when a new bugnote



Parameters

int   $p_bug_id  
[ Top ]



email_bug_deleted [line 771]

null email_bug_deleted( int $p_bug_id)

send notices when a bug is DELETED



Parameters

int   $p_bug_id  
[ Top ]



email_bug_info_to_one_user [line 1153]

bool email_bug_info_to_one_user( array $p_visible_bug_data, string $p_message_id, int $p_project_id, int $p_user_id, [array $p_header_optional_params = null])

Send bug info to given user

return true on success




Parameters

array   $p_visible_bug_data  
string   $p_message_id  
int   $p_project_id  
int   $p_user_id  
array   $p_header_optional_params  
[ Top ]



email_bug_reminder [line 1100]

null email_bug_reminder( array $p_recipients, int $p_bug_id, string $p_message)

Send a bug reminder to each of the given user, or to each user if the first parameter is an array return an array of usernames to which the reminder was successfully sent



Tags:

todo:  I'm not sure this shouldn't return an array of user ids... more work for the caller but cleaner from an API point of view.


Parameters

array   $p_recipients  
int   $p_bug_id  
string   $p_message  
[ Top ]



email_build_subject [line 1041]

null email_build_subject( int $p_bug_id)

formats the subject correctly we include the project name, bug id, and summary.



Parameters

int   $p_bug_id  
[ Top ]



email_build_visible_bug_data [line 1365]

array email_build_visible_bug_data( int $p_user_id, int $p_bug_id, string $p_message_id)

Build the bug raw data visible for specified user to be translated and sent by email to the user

(Filter the bug data according to user access level) return array with bug data. See usage in email_format_bug_message(...)




Parameters

int   $p_user_id  
int   $p_bug_id  
string   $p_message_id  
[ Top ]



email_close [line 744]

null email_close( int $p_bug_id)

send notices when a bug is CLOSED



Parameters

int   $p_bug_id  
[ Top ]



email_collect_recipients [line 196]

array email_collect_recipients( int $p_bug_id, string $p_notify_type, [array $p_extra_user_ids_to_email = array()])



Tags:

todo:  yarick123: email_collect_recipients(...) will be completely rewritten to provide additional information such as language, user access,..
todo:  yarick123:sort recipients list by language to reduce switches between different languages


Parameters

int   $p_bug_id  
string   $p_notify_type  
array   $p_extra_user_ids_to_email  
[ Top ]



email_ensure_not_disposable [line 159]

null email_ensure_not_disposable( string $p_email)

Check if the email address is disposable

trigger an ERROR if it isn't




Parameters

string   $p_email  
[ Top ]



email_ensure_valid [line 134]

null email_ensure_valid( string $p_email)

Check if the email address is valid

trigger an ERROR if it isn't




Parameters

string   $p_email  
[ Top ]



email_format_attribute [line 1349]

string email_format_attribute( array $p_visible_bug_data, $attribute_id, string $p_attribute_id)

if $p_visible_bug_data contains specified attribute the function returns concatenated translated attribute name and original attribute value. Else return empty string.



Parameters

array   $p_visible_bug_data  
string   $p_attribute_id  
   $attribute_id  
[ Top ]



email_format_bug_message [line 1202]

string email_format_bug_message( array $p_visible_bug_data)

Build the bug info part of the message



Parameters

array   $p_visible_bug_data  
[ Top ]



email_generic [line 543]

bool email_generic( int $p_bug_id, string $p_notify_type, [int $p_message_id = null], [array $p_header_optional_params = null], [array $p_extra_user_ids_to_email = array()])

send a generic email $p_notify_type: use check who she get notified of such event.

$p_message_id: message id to be translated and included at the top of the email message. Return false if it were problems sending email * @param string




Parameters

int   $p_bug_id  
string   $p_notify_type  
int   $p_message_id  
array   $p_header_optional_params   = null
array   $p_extra_user_ids_to_email  
[ Top ]



email_is_disposable [line 145]

bool email_is_disposable( string $p_email)

Check if the email address is disposable



Parameters

string   $p_email  
[ Top ]



email_is_valid [line 76]

bool email_is_valid( string $p_email)

check to see that the format is valid and that the mx record exists



Parameters

string   $p_email  
[ Top ]



email_monitor_added [line 588]

null email_monitor_added( int $p_bug_id, int $p_user_id)

Send notices that a user is now monitoring the bug. Typically this will only be sent when the added user is not the logged in user. This is assuming that receive own notifications is OFF (default).



Parameters

int   $p_bug_id  
int   $p_user_id  
[ Top ]



email_new_bug [line 717]

null email_new_bug( int $p_bug_id)

send notices when a new bug is added



Parameters

int   $p_bug_id  
[ Top ]



email_notify_flag [line 175]

int email_notify_flag( string $action, string $flag)

email_notify_flag Get the value associated with the specific action and flag.

For example, you can get the value associated with notifying "admin" on action "new", i.e. notify administrators on new bugs which can be ON or OFF.




Parameters

string   $action  
string   $flag  
[ Top ]



email_notify_new_account [line 503]

null email_notify_new_account( string $p_username, string $p_email)

notify the selected group a new user has signup



Parameters

string   $p_username  
string   $p_email  
[ Top ]



email_regex_simple [line 66]

string email_regex_simple( )

Use a simple perl regex for valid email addresses. This is not a complete regex, as it does not cover quoted addresses or domain literals, but it is simple and covers the vast majority of all email addresses without being overly complex.



[ Top ]



email_relationship_added [line 605]

null email_relationship_added( int $p_bug_id, int $p_related_bug_id, int $p_rel_type)

send notices when a relationship is ADDED



Parameters

int   $p_bug_id  
int   $p_related_bug_id  
int   $p_rel_type  
[ Top ]



email_relationship_child_closed [line 650]

null email_relationship_child_closed( int $p_bug_id)

send notices to all the handlers of the parent bugs when a child bug is CLOSED



Parameters

int   $p_bug_id  
[ Top ]



email_relationship_child_resolved [line 641]

null email_relationship_child_resolved( int $p_bug_id)

send notices to all the handlers of the parent bugs when a child bug is RESOLVED



Parameters

int   $p_bug_id  
[ Top ]



email_relationship_child_resolved_closed [line 661]

null email_relationship_child_resolved_closed( int $p_bug_id, int $p_message_id)

send notices to all the handlers of the parent bugs still open when a child bug is resolved/closed



Parameters

int   $p_bug_id  
int   $p_message_id  
[ Top ]



email_relationship_deleted [line 624]

null email_relationship_deleted( int $p_bug_id, int $p_related_bug_id, int $p_rel_type)

send notices when a relationship is DELETED



Parameters

int   $p_bug_id  
int   $p_related_bug_id  
int   $p_rel_type  
[ Top ]



email_reopen [line 753]

null email_reopen( int $p_bug_id)

send notices when a bug is REOPENED



Parameters

int   $p_bug_id  
[ Top ]



email_resolved [line 735]

null email_resolved( int $p_bug_id)

send notices when a bug is RESOLVED



Parameters

int   $p_bug_id  
[ Top ]



email_send [line 867]

bool email_send( EmailData $p_email_data)

This function sends an email message based on the supplied email data.



Parameters

EmailData   $p_email_data  
[ Top ]



email_send_all [line 833]

null email_send_all( [bool $p_delete_on_failure = false])

This function sends all the emails that are stored in the queue. If a failure occurs, then the function exists. This function will be called after storing emails in case of synchronous emails, or will be called from a cronjob in case of asynchronous emails.



Tags:

todo:  In case of synchronous email sending, we may get a race condition where two requests send the same email.


Parameters

bool   $p_delete_on_failure   indicates whether to remove email from queue on failure (default false)
[ Top ]



email_send_confirm_hash_url [line 467]

null email_send_confirm_hash_url( int $p_user_id, string $p_confirm_hash)

Send confirm_hash url to user forgets the password



Parameters

int   $p_user_id  
string   $p_confirm_hash  
[ Top ]



email_signup [line 423]

null email_signup( int $p_user_id, string $p_password, string $p_confirm_hash, [string $p_admin_name = ''])

Send password to user



Parameters

int   $p_user_id  
string   $p_password  
string   $p_confirm_hash  
string   $p_admin_name  
[ Top ]



email_smtp_close [line 1022]

null email_smtp_close( [string 0 = ])

closes opened kept alive SMTP connection (if it was opened)



Parameters

string   0  
[ Top ]



email_sponsorship_added [line 690]

null email_sponsorship_added( int $p_bug_id)

send notices when a bug is sponsored



Parameters

int   $p_bug_id  
[ Top ]



email_sponsorship_deleted [line 708]

null email_sponsorship_deleted( int $p_bug_id)

send notices when a sponsorship is deleted



Parameters

int   $p_bug_id  
[ Top ]



email_sponsorship_updated [line 699]

null email_sponsorship_updated( int $p_bug_id)

send notices when a sponsorship is modified



Parameters

int   $p_bug_id  
[ Top ]



email_store [line 784]

int email_store( string $p_recipient, string $p_subject, string $p_message, [array $p_headers = null])

Store email in queue for sending



Parameters

string   $p_recipient  
string   $p_subject  
string   $p_message  
array   $p_headers  
[ Top ]



make_lf_crlf [line 1060]

null make_lf_crlf( string $p_string)

clean up LF to CRLF



Parameters

string   $p_string  
[ Top ]



Documentation generated on Sun, 12 Dec 2010 23:50:25 +0900 by phpDocumentor 1.4.3
inserted by FC2 system