ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSendMailActivity Class Reference

PhpIncludeInspection More...

+ Inheritance diagram for ilSendMailActivity:
+ Collaboration diagram for ilSendMailActivity:

Public Member Functions

 __construct (ilNode $a_context)
 Default constructor. More...
 
 getContext ()
 Returns a reference to the parent node. More...
 
 setName ($name)
 
 getName ()
 
 getMessageName ()
 
 setMessageName ($message_name)
 
 getParameters ()
 
 setParameters ($parameters)
 
 getOutputs ()
 
 setOutputs ($outputs)
 
 decodeMessageText ($message_text)
 
 processPlaceholders ($message_text)
 
- Public Member Functions inherited from ilActivity
 execute ()
 

Protected Attributes

 $name
 

Private Attributes

 $context
 
 $message_name
 
 $parameters
 
 $outputs
 

Detailed Description

PhpIncludeInspection

PhpIncludeInspection Class ilSendMailActivity

This activity setup and send or read an email.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

/

Definition at line 19 of file class.ilSendMailActivity.php.

Constructor & Destructor Documentation

◆ __construct()

ilSendMailActivity::__construct ( ilNode  $a_context)

Default constructor.

Parameters
ilNode$a_context

Definition at line 41 of file class.ilSendMailActivity.php.

References decodeMessageText(), ilActivity\execute(), getContext(), and processPlaceholders().

42  {
43  $this->context = $a_context;
44  }
+ Here is the call graph for this function:

Member Function Documentation

◆ decodeMessageText()

ilSendMailActivity::decodeMessageText (   $message_text)

Definition at line 162 of file class.ilSendMailActivity.php.

Referenced by __construct().

163  {
164  return base64_decode($message_text);
165  }
+ Here is the caller graph for this function:

◆ getContext()

ilSendMailActivity::getContext ( )

Returns a reference to the parent node.

Returns
ilNode Reference to the parent node.

Implements ilWorkflowEngineElement.

Definition at line 93 of file class.ilSendMailActivity.php.

References $context.

Referenced by __construct(), and processPlaceholders().

94  {
95  return $this->context;
96  }
+ Here is the caller graph for this function:

◆ getMessageName()

ilSendMailActivity::getMessageName ( )
Returns
string

Definition at line 117 of file class.ilSendMailActivity.php.

References $message_name.

118  {
119  return $this->message_name;
120  }

◆ getName()

ilSendMailActivity::getName ( )
Returns
string

Implements ilWorkflowEngineElement.

Definition at line 109 of file class.ilSendMailActivity.php.

References $name.

110  {
111  return $this->name;
112  }

◆ getOutputs()

ilSendMailActivity::getOutputs ( )
Returns
array

Definition at line 149 of file class.ilSendMailActivity.php.

References $outputs.

150  {
151  return $this->outputs;
152  }

◆ getParameters()

ilSendMailActivity::getParameters ( )
Returns
array

Definition at line 133 of file class.ilSendMailActivity.php.

References $parameters.

134  {
135  return $this->parameters;
136  }

◆ processPlaceholders()

ilSendMailActivity::processPlaceholders (   $message_text)

Definition at line 167 of file class.ilSendMailActivity.php.

References $DIC, PHPMailer\PHPMailer\$params, $type, ilUtil\_getHttpPath(), and getContext().

Referenced by __construct().

168  {
169  $matches = array();
170  preg_match_all('/\[(.*?)\]/', $message_text, $matches, PREG_PATTERN_ORDER);
171 
172  foreach ($matches[0] as $match) {
173  $placeholder = substr($match, 1, strlen($match) - 2);
174 
175  $handled = false;
176  if (strtolower(substr($placeholder, 0, strlen('EVENTLINK'))) == 'eventlink') {
177  $handled = true;
178  $content = $this->getEventLink($match);
179  }
180 
181  if (!$handled) {
182  $content = $this->context->getContext()->getInstanceVarById($placeholder);
183  }
184 
185  if (strlen($content)) {
186  $message_text = str_replace($match, $content, $message_text);
187  }
188  }
189  return $message_text;
190  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMessageName()

ilSendMailActivity::setMessageName (   $message_name)
Parameters
string$message_name

Definition at line 125 of file class.ilSendMailActivity.php.

References $message_name.

126  {
127  $this->message_name = $message_name;
128  }

◆ setName()

ilSendMailActivity::setName (   $name)
Parameters
string$name

Implements ilWorkflowEngineElement.

Definition at line 101 of file class.ilSendMailActivity.php.

References $name.

102  {
103  $this->name = $name;
104  }

◆ setOutputs()

ilSendMailActivity::setOutputs (   $outputs)
Parameters
array$outputs

Definition at line 157 of file class.ilSendMailActivity.php.

References $outputs.

158  {
159  $this->outputs = $outputs;
160  }

◆ setParameters()

ilSendMailActivity::setParameters (   $parameters)
Parameters
array$parameters

Definition at line 141 of file class.ilSendMailActivity.php.

References $parameters.

142  {
143  $this->parameters = $parameters;
144  }

Field Documentation

◆ $context

ilSendMailActivity::$context
private

Definition at line 22 of file class.ilSendMailActivity.php.

Referenced by getContext().

◆ $message_name

ilSendMailActivity::$message_name
private

Definition at line 25 of file class.ilSendMailActivity.php.

Referenced by getMessageName(), and setMessageName().

◆ $name

ilSendMailActivity::$name
protected

Definition at line 28 of file class.ilSendMailActivity.php.

Referenced by getName(), and setName().

◆ $outputs

ilSendMailActivity::$outputs
private

Definition at line 34 of file class.ilSendMailActivity.php.

Referenced by getOutputs(), and setOutputs().

◆ $parameters

ilSendMailActivity::$parameters
private

Definition at line 31 of file class.ilSendMailActivity.php.

Referenced by getParameters(), and setParameters().


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