PHP Class Whups_Mail, horde

Copyright 2004-2016 Horde LLC (http://www.horde.org/) See the enclosed file LICENSE for license information (BSD). If you did not receive this file, see http://www.horde.org/licenses/bsdl.php.
Author: Jason M. Felice ([email protected])
Author: Jan Schneider ([email protected])
Show file Open project: horde/horde

Public Methods

Method Description
processMail ( string $text, array $info, string $auth_user = null ) : Whups_Ticket Parse a MIME message and create a new ticket.

Protected Methods

Method Description
_findAuthUser ( string $from ) : string Searches the From: header for an email address contained in one of our users' identities.
_findTicket ( array $info ) : integer Returns the ticket number matching the provided information.

Method Details

_findAuthUser() protected static method

Searches the From: header for an email address contained in one of our users' identities.
protected static _findAuthUser ( string $from ) : string
$from string The From address.
return string The Horde user name that matches the headers' From: address or null if the users can't be listed or no match has been found.

_findTicket() protected static method

Returns the ticket number matching the provided information.
protected static _findTicket ( array $info ) : integer
$info array A hash with ticket information.
return integer The ticket number if has been passed in the subject, false otherwise.

processMail() public static method

Parse a MIME message and create a new ticket.
public static processMail ( string $text, array $info, string $auth_user = null ) : Whups_Ticket
$text string This is the full text of the MIME message.
$info array An array of information for the new ticket. This should include: - 'queue' => queue id - 'type' => type id - 'state' => state id - 'priority' => priority id - 'ticket' => ticket id (prevents creation of new tickets)
$auth_user string This will be the Horde user that creates the ticket. If null, we will try to deduce from the message's From: header. We do NOT default to $GLOBALS['registry']->getAuth().
return Whups_Ticket Ticket.