Mailer/Mailer.php
public function addValues($values, $prefix = null)
    {    
    	if(!is_array($values))
    	{
    		throw new MailerException('KarisMailer->setValues arrays');
    	}
    	foreach($values as $key => $value)
    	{
    		if(is_array($value))
    		{
    			unset($values[$key]);
    		}
    		elseif(is_object($value))
    		{
    			try
    			{
    				$values[$key] = $value;
    			}
    			catch(\Exception $e)
    			{
    				unset($values[$key]);
    			}
    		}
    		elseif($prefix)
    		{
    			$values[$prefix.$key] = $value;
    			unset($values[$key]);
    		}
    	}
    
    	$this->values = array_merge($this->values, $values);
    
    	return $this;
    }
public function addValues($values, $prefix = null)
    {    
    	if(!is_array($values))
    	{
    		throw new MailerException('KarisMailer->setValues arrays');
    	}
    	foreach($values as $key => $value)
    	{
    		if(is_array($value))
    		{
    			unset($values[$key]);
    		}
    		elseif(is_object($value))
    		{
    			try
    			{
    				$values[$key] = $value;
    			}
    			catch(\Exception $e)
    			{
    				unset($values[$key]);
    			}
    		}
    		elseif($prefix)
    		{
    			$values[$prefix.$key] = $value;
    			unset($values[$key]);
    		}
    	}
    
    	$this->values = array_merge($this->values, $values);
    
    	return $this;
    }
public function addValues ( $ values , $ prefix = null ) { if ( ! is_array ( $ values ) ) { throw new MailerException ( 'KarisMailer->setValues arrays' ) ; } foreach ( $ values as $ key => $ value ) { if ( is_array ( $ value ) ) { unset ( $ values [ $ key ] ) ; } elseif ( is_object ( $ value ) ) { try { $ values [ $ key ] = $ value ; } catch ( \ Exception $ e ) { unset ( $ values [ $ key ] ) ; } } elseif ( $ prefix ) { $ values [ $ prefix . $ key ] = $ value ; unset ( $ values [ $ key ] ) ; } } $ this -> values = array_merge ( $ this -> values , $ values ) ; return $ this ; }
Add values to the mail that will be available in the template

@param   mixed   $data   array
@param   string  $prefix a prefix for this data
@return  Mailer  $this
Add values to the mail that will be available in the template