# \hhu\z\apisMailApi

MailApi-implementation.

This class runs and renders e‑mail text and subject.

## Summary

Methods
Properties
Constants
__construct()
run()
render()
setLinker()
setHTML()
setMessage()
setParams()
getSubject()
No public properties found
No constants found
log()
$request
$response
$log
N/A
loadToplevelAgent()
addParams()
$toplevelAgent
N/A

File
  app/apis/MailApi.inc
Package
  Default
Class hierarchy
  \nre\core\Api
  \hhu\z\apis\MailApi

## Tags

author | Oliver Hanraths oliver.hanraths@uni-duesseldorf.de

## Properties

### $request

    $request : \nre\core\Request

Die aktuelle Anfrage

#### Type

\nre\core\Request

#

Inherited from
  \nre\core\Api

## Tags

None found

### $response

    $response : \nre\core\Response

Die aktuelle Antwort

#### Type

\nre\core\Response

#

Inherited from
  \nre\core\Api

## Tags

None found

### $log

    $log : \nre\core\Logger

Log-System

#### Type

\nre\core\Logger

#

Inherited from
  \nre\core\Api

## Tags

None found

### $toplevelAgent

    $toplevelAgent : \nre\agents\ToplevelAgent

Der Toplevelagent

#### Type

\nre\agents\ToplevelAgent

#

Inherited from
  \nre\core\Api

## Tags

None found

## Methods

### __construct()

    __construct()

Construct a new MailApi.

#

## Tags

None found

### run()

    run() : \Exception

Run mailtext generation.

This method runs the generation of mailtext.

#### Returns

\Exception —

Occured exception or null

#

## Tags

None found

### render()

    render() : string

Render output.

#### Returns

string —

Rendered output

#

## Tags

None found

### setLinker()

    setLinker(\nre\core\Linker  $linker)

Set linker instance for creating links.

#### Parameters

\nre\core\Linker | $linker | Linker instance for creating links

#

## Tags

None found

### setHTML()

    setHTML(boolean  $html = true)

Use a ToplevelAgent for HTML-mail

#### Parameters

boolean | $html | Whether to use HTML or not

#

## Tags

None found

### setMessage()

    setMessage(string  $messageAgent)

Set the Action for the message to render.

#### Parameters

string | $messageAgent | Agent to handle the message

#

## Tags

None found

### setParams()

    setParams(array  $params)

Set additional params to pass to the Action.

#### Parameters

array | $params | Additional params to set

#

## Tags

None found

### getSubject()

    getSubject() : string

Return the subject set by the Controller.

#### Returns

string —

Subject set by Controller

#

## Tags

None found

### log()

    log(\Exception  $exception, integer  $logMode)

Log an exception

#### Parameters

\Exception | $exception | Occurred exception
integer | $logMode | Log-mode

#

Inherited from
  \nre\core\Api

## Tags

None found

### loadToplevelAgent()

    loadToplevelAgent()

Load the ToplevelAgent specified by the request.

#### Throws

\nre\exceptions\ServiceUnavailableException
\nre\exceptions\AgentNotValidException
\nre\exceptions\AgentNotFoundException

#

Inherited from
  \nre\core\Api

## Tags

None found

### addParams()

    addParams(array  $params)

Add multiple request params.

#### Parameters

array | $params | Request params to add

#

## Tags

None found

### MailApi.inc