Ejemplo n.º 1
0
    /**
     * Prepares the final text of an email
     * @access private
     * @param string $notification
     * @param array $options
     */
    private function __prepareEmail($notification, $options = null){
        $html = '';
        $text = '';
        $language = 'en';
        $message = $this->__notificiations[$language][$notification];

        switch($notification){
            case 'invitation_to_join':
                $html = sprintf(
                $message['email']['html_body'],
                $options['invitee'],
                Configure::read('Domain.host'), //Product or Domain
                Configure::read('Domain.url'), //FQDN
                $options['token']
                );
                break;

            case 'password_reset':
                $html = sprintf(
                    $message['email']['html_body'],
                    Configure::read('Domain.url'), //FQDN
                    Configure::read('Domain.host'), //Product or Domain
                    $options['token'],
                    $options['ip']
                );

                $text = sprintf(
                    $message['email']['text_body'],
                    Configure::read('Domain.url'),  //FQDN
                    Configure::read('Domain.host'), //Product or Domain
                    $options['token'],
                    $options['ip']
                );
                break;
        }

        return array('html'=>Scrub::htmlStrict($html), 'text'=>Scrub::noHTML($text));
    }
Ejemplo n.º 2
0
 /**
  * A wrapper for Scrub.phoneNumber
  * @param string $value
  * @return string
  */
 public function phoneNumber($value){
     return Scrub::phoneNumber($value);
 }
Ejemplo n.º 3
0
  /**
   * Tests the repair of broken tags
   *
   * @return void
   * @access public
   */
  public function testHtmlMediaFixesBrokenTags() {

    $input = '<p></p';
    $expected = '<p></p>';

    $scrubed = Scrub::htmlMedia($input);

    $this->assertEquals($scrubed, $expected);
  }