Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Abstract class describing Inbound Message Handlers.

Copyright: 2014 Andrew Nicols
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 306 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: handler  - X-Ref

Abstract class describing Inbound Message Handlers.

__get($key)   X-Ref
Magic getter to fetch the specified key.

param: string $key The name of the key to retrieve

set_id($id)   X-Ref
Set the id name.

return: int The newly set id
param: int $id The id to set

set_component($component)   X-Ref
Set the component name.

return: string The newly set component
param: string $component The component to set

can_change_validateaddress()   X-Ref
Whether the current handler allows changes to the address validation
setting.

By default this will return true, but for some handlers it may be
necessary to disallow such changes.

return: boolean

set_validateaddress($validateaddress)   X-Ref
Set whether validation of the address is required.

return: bool
param: bool $validateaddress The new state of validateaddress

can_change_defaultexpiration()   X-Ref
Whether the current handler allows changes to expiry of the generated email address.

By default this will return true, but for some handlers it may be
necessary to disallow such changes.

return: boolean

can_change_enabled()   X-Ref
Whether this handler can be disabled (or enabled).

By default this will return true, but for some handlers it may be
necessary to disallow such changes. For example, a core handler to
handle rejected mail validation should not be disabled.

return: boolean

set_enabled($enabled)   X-Ref
Set the enabled name.

return: bool
param: bool $enabled The new state of enabled

set_defaultexpiration($period)   X-Ref
Set the default validity for new keys.

return: int
param: int $period The time in seconds before a key expires

get_classname()   X-Ref
Get the non-namespaced name of the current class.

return: string The classname

get_success_message(\stdClass $messagedata, $handlerresult)   X-Ref
Return the content of any success notification to be sent.
Both an HTML and Plain Text variant must be provided.

If this handler does not need to send a success notification, then
it should return a falsey value.

return: \stdClass with keys `html` and `plain`.
param: \stdClass $messagedata The message data.
param: \stdClass $handlerresult The record for the newly created post.

remove_quoted_text($messagedata)   X-Ref
Remove quoted message string from the text (NOT HTML) message.

return: array message and message format to use.
param: \stdClass $messagedata The Inbound Message record