mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-19 18:32:52 +09:00
Allow adding arbitrary extra vars to SMS
This commit is contained in:
parent
98b32a2572
commit
f4c4ec5ec6
3 changed files with 63 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ class SMS
|
|||
protected $subject = '';
|
||||
protected $content = '';
|
||||
protected $attachments = array();
|
||||
protected $extra_vars = array();
|
||||
protected $delay_timestamp = 0;
|
||||
protected $force_sms = false;
|
||||
protected $allow_split_sms = true;
|
||||
|
|
@ -323,6 +324,51 @@ class SMS
|
|||
return $this->attachments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set an extra variable.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function setExtraVar($key, $value)
|
||||
{
|
||||
$this->extra_vars[$key] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an extra variable.
|
||||
*
|
||||
* @param string $key
|
||||
* @return mixed
|
||||
*/
|
||||
public function getExtraVar($key)
|
||||
{
|
||||
return isset($this->extra_vars[$key]) ? $this->extra_vars[$key] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all extra variables.
|
||||
*
|
||||
* @param string $key
|
||||
* @return mixed
|
||||
*/
|
||||
public function getExtraVars()
|
||||
{
|
||||
return $this->extra_vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set all extra variables.
|
||||
*
|
||||
* @param array $vars
|
||||
* @return void
|
||||
*/
|
||||
public function setExtraVars(array $vars)
|
||||
{
|
||||
$this->extra_vars = $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delay sending the message.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue