Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
mod_forum\message\inbound\reply_handler Class Reference

A Handler to process replies to forum posts. More...

Inheritance diagram for mod_forum\message\inbound\reply_handler:
core\message\inbound\handler

Public Member Functions

 __get ($key)
 Magic getter to fetch the specified key. More...
 
 can_change_defaultexpiration ()
 Whether the current handler allows changes to expiry of the generated email address. More...
 
 can_change_enabled ()
 Whether this handler can be disabled (or enabled). More...
 
 can_change_validateaddress ()
 Whether the current handler allows changes to the address validation setting. More...
 
 get_description ()
 Return a description for the current handler. More...
 
 get_name ()
 Return a short name for the current handler. More...
 
 get_success_message (\stdClass $messagedata, $handlerresult)
 Return the content of any success notification to be sent. More...
 
 process_message (\stdClass $record, stdClass $messagedata)
 Process a message received and validated by the Inbound Message processor. More...
 
 set_component ($component)
 Set the component name. More...
 
 set_defaultexpiration ($period)
 Set the default validity for new keys. More...
 
 set_enabled ($enabled)
 Set the enabled name. More...
 
 set_id ($id)
 Set the id name. More...
 
 set_validateaddress ($validateaddress)
 Set whether validation of the address is required. More...
 

Protected Member Functions

 process_attachment ($acceptedtypes, context_user $context, $itemid, stdClass $attachment)
 Process attachments included in a message. More...
 

Static Protected Member Functions

static remove_quoted_text ($messagedata)
 Remove quoted message string from the text (NOT HTML) message. More...
 

Detailed Description

A Handler to process replies to forum posts.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ __get()

core\message\inbound\handler::__get (   $key)
inherited

Magic getter to fetch the specified key.

Parameters
string$keyThe name of the key to retrieve

◆ can_change_defaultexpiration()

core\message\inbound\handler::can_change_defaultexpiration ( )
inherited

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 values
boolean

Reimplemented in core\message\inbound\private_files_handler.

◆ can_change_enabled()

core\message\inbound\handler::can_change_enabled ( )
inherited

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 values
boolean

◆ can_change_validateaddress()

core\message\inbound\handler::can_change_validateaddress ( )
inherited

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 values
boolean

Reimplemented in tool_messageinbound\message\inbound\invalid_recipient_handler.

◆ get_description()

mod_forum\message\inbound\reply_handler::get_description ( )

Return a description for the current handler.

Return values
string

Reimplemented from core\message\inbound\handler.

◆ get_name()

mod_forum\message\inbound\reply_handler::get_name ( )

Return a short name for the current handler.

This appears in the admin pages as a human-readable name.

Return values
string

Reimplemented from core\message\inbound\handler.

◆ get_success_message()

mod_forum\message\inbound\reply_handler::get_success_message ( \stdClass  $messagedata,
  $handlerresult 
)

Return the content of any success notification to be sent.

Both an HTML and Plain Text variant must be provided.

Parameters
stdClass$messagedataThe message data.
stdClass$handlerresultThe record for the newly created post.
Return values
stdClasswith keys html and plain.

Reimplemented from core\message\inbound\handler.

◆ process_attachment()

mod_forum\message\inbound\reply_handler::process_attachment (   $acceptedtypes,
context_user  $context,
  $itemid,
stdClass  $attachment 
)
protected

Process attachments included in a message.

Parameters
string[]$acceptedtypesString The mimetypes of the acceptable attachment types.
context_user$contextcontext_user The context of the user creating this attachment.
int$itemidint The itemid to store this attachment under.
stdClass$attachmentstdClass The Attachment data to store.
Return values
stored_file

◆ process_message()

mod_forum\message\inbound\reply_handler::process_message ( \stdClass  $record,
stdClass  $messagedata 
)

Process a message received and validated by the Inbound Message processor.

Exceptions
core::message::inbound::processing_failed_exception
Parameters
stdClass$messagedataThe Inbound Message record
stdClass$messagedataThe message data packet
Return values
boolWhether the message was successfully processed.

Reimplemented from core\message\inbound\handler.

◆ remove_quoted_text()

static core\message\inbound\handler::remove_quoted_text (   $messagedata)
staticprotectedinherited

Remove quoted message string from the text (NOT HTML) message.

Parameters
stdClass$messagedataThe Inbound Message record
Return values
arraymessage and message format to use.

◆ set_component()

core\message\inbound\handler::set_component (   $component)
inherited

Set the component name.

Parameters
string$componentThe component to set
Return values
stringThe newly set component

◆ set_defaultexpiration()

core\message\inbound\handler::set_defaultexpiration (   $period)
inherited

Set the default validity for new keys.

Parameters
int$periodThe time in seconds before a key expires
Return values
int

◆ set_enabled()

core\message\inbound\handler::set_enabled (   $enabled)
inherited

Set the enabled name.

Parameters
bool$enabledThe new state of enabled
Return values
bool

◆ set_id()

core\message\inbound\handler::set_id (   $id)
inherited

Set the id name.

Parameters
int$idThe id to set
Return values
intThe newly set id

◆ set_validateaddress()

core\message\inbound\handler::set_validateaddress (   $validateaddress)
inherited

Set whether validation of the address is required.

Parameters
bool$validateaddressThe new state of validateaddress
Return values
bool

The documentation for this class was generated from the following file: