Zum Inhalt springen

mail versenden

Erstellt am 5. Juni 2008 · 3 Antworten · letzte Antwort am 5. Juni 2008

Tags: Frage

mike_sebaro ·

Hallo

ich hab hier eine Extension bekommen. nachdem alles abgearbeitet wurde verschickt die extension eine Mail.
Ich suche schon die ganze zeit, wo der email text stehen könnten, allerdings find ich nichts wo mich drauf schließen lässt, wo der email text definiert sein könnte.

Könnt ihr mir hierbei helfen?

Mfg Mike

<?php
define('FPDF_FONTPATH', t3lib_extMgm::extPath('sm_enquiry').'ufpdf/font/');
require_once(PATH_t3lib.'class.t3lib_htmlmail.php');
require_once(PATH_tslib.'class.tslib_pibase.php');
#require_once(PATH_site.'typo3conf/ext/fpdf/fpdf.php');
require_once(t3lib_extMgm::extPath('sm_enquiry').'ufpdf/ufpdf.php');

/**
 */
class tx_smenquiry_pi1 extends tslib_pibase {
	var $prefixId      = 'tx_smenquiry_pi1';		// Same as class name
	var $scriptRelPath = 'pi1/class.tx_smenquiry_pi1.php';	// Path to this script relative to the extension dir.
	var $extKey        = 'sm_enquiry';	// The extension key.
	var $pi_checkCHash = true;


	var $action = NULL;
	var $templateFile = NULL;


	var $L   = NULL;
	var $langData = Array();
	var $lang = NULL;

	var $localLang =  Array();
	var $gpVar = Array();
	var $targetPid = NULL;
	var $categoryId = NULL;
	var $tableName = NULL;
	var $fieldList = Array();
	var $imagePath = NULL;
	var $defaultImage = "";
	var $adminEmail;
	var $imageName   = NULL;
	var $showImage = NULL;
	var $options = Array();
	var $firstLevel = Array();
	var $seacondLevel = Array();
	var $sendmailAttachment;
	var $mailSubject;
	var $email;
	var $senderEmail;
	var $mailMessage;
	var $pdfUid;
	var $categoryValue;
	var $pdfCategory;

	/**
	 * The main method of the PlugIn
	 *
	 * @param	string		$content: The PlugIn content
	 * @param	array		$conf: The PlugIn configuration
	 * @return	The content that is displayed on the website
	 */
	function main($content,$conf)	{		
		
		$this->conf=$conf;
		$this->pi_setPiVarDefaults();
		$this->pi_loadLL();

		$this->pi_initPIflexForm(); // Init and get the flexform data of the plugin
		$this->lConf = array(); // Setup our storage array...
		$piFlexForm = $this->cObj->data['pi_flexform'];		
		foreach ($piFlexForm['data'] as $sheet => $data){
			foreach ($data as $lang => $value){
				foreach ($value as $key => $val){

					$this->lConf[$key] = $this->pi_getFFvalue($piFlexForm, $key, $sheet);
				}
			}
		}
		//tablename	
		$this->tableName  = (!empty($this->lConf['tableName'])) ? $this->lConf['tableName'] :"tt_address";

		$this->siteUrl = t3lib_div::getIndpEnv('TYPO3_SITE_URL');


		$this->senderEmail  = ( !empty($this->conf['senderEmail'])) ? $this->conf['senderEmail'] :" ";
		$this->adminEmail  = ( !empty($this->conf['adminEmail'])) ? $this->conf['adminEmail'] :    $this->lConf['adminEmail'];
		$this->mailSubject  = ( !empty($this->conf['mailSubject'])) ? $this->conf['mailSubject'] :"Konto registriert";
		
		//image path
		$this->imagePath = ($this->lConf['imagePath']) ? $this->lConf['imagePath']
		: ($this->conf['imagePath']  ? $this->conf['imagePath'] : $this->siteUrl."uploads/pics/" );
		$this->imageName = $_FILES[$this->prefixId]['name'][$this->tableName][image];
		$imagePath = PATH_site."uploads/pics/".$this->imageName;

		$this->defaultImage = ($this->conf['defaultImage']) ? $this->conf['defaultImage'] : "dummy.jpeg";

		$this->showImage = $this->siteUrl."uploads/pics/".$_FILES[$this->prefixId]['name'][$this->tableName][image];

		if(empty($_FILES[$this->prefixId]['name'][$this->tableName][image])){
			$this->showImage = $this->siteUrl."typo3conf/ext/sm_enquiry/res/image/".$this->defaultImage ;
		}

		if(!empty($_FILES[$this->prefixId]['name'][$this->tableName][image])){
			@chmod($this->siteUrl.'uploads/pics/',0777);
			$tmpname = $_FILES[$this->prefixId]['tmp_name'][$this->tableName][image];

			$tmpname = str_replace('\\','/',$tmpname);

			if(t3lib_div::upload_copy_move($tmpname,$imagePath)) {

			}
		}

		$this->templateFile  = (!empty($this->lConf['templateFile'])) ? $this->lConf['templateFile'] :
		t3lib_extMgm::siteRelPath($this->extKey) .'res/'.$this->extKey.".html";

		$this->L = (t3lib_div::_GP ('L')) ? t3lib_div::_GP ('L') :  0 ;

		$this->localLang = (in_array($this->lang,array_keys($this->LOCAL_LANG)))
		?  $this->LOCAL_LANG[$this->lang]:$this->LOCAL_LANG['default'];

		$this->targetPid = (!empty($this->lConf['targetPid']))? $this->lConf['targetPid'] : $GLOBALS['TSFE']->id;

		$this->categoryId = ($this->lConf['categoryId']) ? $this->lConf['categoryId']
		: ($this->conf['storePid']  ? $this->conf['storePid'] : $GLOBALS['TSFE']->id );


		$this->fieldList = explode(",",$GLOBALS['TCA'][$this->tableName]['feInterface']['fe_admin_fieldList']);

		$this->gpVar = t3lib_div::_GP($this->prefixId);

		$this->firstCategory = $this->getFirstCatgoryname($this->piVars['tt_category_mm']['categorytitle']);
	
		$this->readLanguageData();
		$this->readLanguageWord();

		$this->action = (!empty($_GET['action']))?$_GET['action']:strtolower($this->lConf['action']);

		switch(strtolower($this->action)){
			case 'submit' :

				if ($this->gpVar['action']){
					$this->saveForm();

					$content = $this->getEnquiryForm("confirm");


				}else {
					$content = $this->getEnquiryForm();
				}
				break;
			case 'ajax':
				$content = $this->getUid();

				break;
			case 'pdf':
				$this->getPDF('','','');
				break;

           default :
				break;

		}

		return $this->pi_wrapInBaseClass($content);


	}

	function getUrl($getParam=null) {

		//$baseURL = empty($GLOBALS["TSFE"]->config["config"]["baseURL"]) ? t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR') : $GLOBALS["TSFE"]->config["config"]["baseURL"];
		$baseURL = t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR');

		$url = $baseURL . $this->pi_getPageLink($GLOBALS['TSFE']->id, null, $getParam);

		return $url;
	}

	function saveForm(){

		$thirdcategorypid = "";
		if(intval($this->gpVar['tt_address']['tx_spdirectory_cat']) > 0) {
			$thirdcategorypid = $this->gpVar['tt_address']['tx_spdirectory_cat'];
			$this->gpVar['tt_address']['tx_spdirectory_cat'] = 1;
		}else {
			$this->gpVar['tt_address']['tx_spdirectory_cat'] = 0;
		}
		$this->gpVar['tt_address']['pid'] = $this->categoryId;
		$this->gpVar['tt_address']['tstamp'] = time();
		$this->gpVar['tt_address']['hidden'] = 1;
		$this->gpVar['tt_address']['image'] =  ($this->imageName) ? $this->imageName :$this->defaultImage;

		if(!($GLOBALS['TYPO3_DB']->exec_INSERTquery($this->tableName,$this->gpVar['tt_address']))){
			print mysql_error();
		}
		else{
			$category = array();
			$this->pdfUid = mysql_insert_id();
			$category['uid_local'] = $this->pdfUid;
			$category['uid_foreign'] = $thirdcategorypid;
			$category['sorting'] = 1;
			if(intval($this->gpVar['tt_address']['tx_spdirectory_cat']) > 0) {
				$GLOBALS['TYPO3_DB']->exec_INSERTquery("tx_spdirectory_cat_mm",$category);
			}

		}
		
		
		
		
		
		if(!empty($this->piVars['tt_category_mm']['catname'])){
			$firstCategory = $this->getFirstCatgoryname($this->piVars['tt_category_mm']['categorytitle']) . "> ";
		
		}
		else{
			$firstCategory = $this->getFirstCatgoryname($this->piVars['tt_category_mm']['categorytitle']);
		}

		if(!empty($this->piVars['tt_address']['tx_spdirectory_cat'])){
			$secondCategory = $this->getCatgoryname($this->piVars['tt_category_mm']['catname']) . " > ";
		}
		else{
			$secondCategory = $this->getCatgoryname($this->piVars['tt_category_mm']['catname']);
		}

		$thirdCategory = $this->getCatgoryname($this->piVars['tt_address']['tx_spdirectory_cat']);

		$this->pdfCategory = $firstCategory . $secondCategory . $thirdCategory;
		
		
		$this->getPDF(PATH_site.'typo3conf/ext/form.pdf',$this->pdfUid,$this->pdfCategory);
		//ob_end_flush();

        $this->mailMessage = ($this->conf['MessageBody']) ? $this->conf['MessageBody'] : "Account Registered";		
		$this->email = $this->gpVar[$this->tableName]['email'];
		$this->sendmailAttachment = true;

		$this->sendMail();

		if(file_exists(PATH_site.'typo3conf/ext/form.pdf')) {
			//unlink(PATH_site.'typo3conf/ext/form.pdf');
		}


	}




	function getEnquiryForm($subAction="") {

		$content='';
		$template['FORM']='';
		$markerTemplate='';
		$marker = '';

		$templatepart = $this->cObj->fileResource($this->templateFile);
		
		$markerTemplate = ($subAction)
		?  strtoupper('###'.$this->extKey."_".$this->action."_".$subAction."###")
		: strtoupper('###'.$this->extKey."_".$this->action."###");

		$template['FORM']= $this->cObj->getSubpart($templatepart,$markerTemplate);
		$marker = Array();
		$marker = $this->initMarkerArray(trim(strtolower($this->action)));

		if (is_Array($this->piVars[$this->tableName])){
			foreach ($this->piVars[$this->tableName] as $key => $val){
				if(!empty($val)) {
					$marker['###'.strtoupper($this->tableName."_".$key)."###"] = $val;
				}
				else {
					$marker['###'.strtoupper($this->tableName."_".$key)."###"] = "";
				}
			}
		}

		$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId]= $this->getjs();

		$content = $this->cObj->substituteMarkerArrayCached($template['FORM'],$marker,array(),array());


		return $content;
	}

	function getCatgoryname($uid) {

		$categoryValue ="";

		$cond  = "uid =".$uid;

		$order= "";
		$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,catname',
		'tx_spdirectory_cat', $cond,$order,'','','');
		if(is_array($rows)) {

			$categoryValue = $rows[0]['catname'];
		}

		return $categoryValue;


	}

	function getFirstCatgoryname($uid) {
	
		$categoryValue ="";

		$cond  = 'uid ="'.$uid.'"' ;

		$order= "";
		$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('pid,uid,catname',
		'tx_spdirectory_cat', $cond,$order,'','','');
	
		if(is_array($rows)) {
			$firstcategoryValue = $rows[0]['catname'];
		}
		
		return $firstcategoryValue;


	}


	function readLanguageData(){
		$fieldList =    $GLOBALS['TCA']['sys_language']['feInterface']['fe_admin_fieldList']
		. $this->extraField;
		$cond  = " uid =".$this->L;

		$order= "";
		$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*',
		'sys_language',   $cond,$order,'','','');
		foreach($rows as $ResearchData){
			$this->langData[] = $ResearchData ;
		}
	}


	function readLanguageWord(){
		if (!count($this->langData)){
			$this->lang = 'default';
			return '';
		}
		$static_lang_isocode  = $this->langData[0]['static_lang_isocode'];
		//static_lang_isocode

		$fieldList =    $GLOBALS['TCA']['static_languages']['feInterface']['fe_admin_fieldList']  ;
		$cond  = " uid =".$static_lang_isocode;
		$order= "";
		$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*','static_languages',   $cond,$order,'','','');
		foreach($rows as $ResearchData){
			$this->lang = strtolower($ResearchData['lg_iso_2'] );
		}
	}


	function outputJs(){
		$cond1  = "pid = '".$this->targetPid."' ";
		$cond2  ="";
		$order= "";


		//fetch data for level_1 select
		$firstrow = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('pid,uid,title',
		'pages',   $cond1,$order,'','','');

		foreach($firstrow as $key=>$value){

			$arrayUid[] = $value['uid'];
			//$optionarray .='<option value="'.$value['uid'].'">'.$value['title'].'</option>';

		}


		foreach($arrayUid as $Uid){
			$cond1  = "pid = '".$Uid."' and tx_msitespdhier_parent = 0 ";
			$order= "";

			$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('pid,uid,catname',
			'tx_spdirectory_cat',$cond1,$order,'','','');
			
			foreach($rows as $keyPid=>$valueCatname){

				$optionarray .='<option value="'.$valueCatname['uid'].'">'.$valueCatname['catname'].'</option>';

			}


		}





		return $optionarray;


	}

	function initMarkerArray($key,$withHash=true) {

		if(!empty($this->piVars['tt_category_mm']['catname'])){
			$firstCategory = $this->getFirstCatgoryname($this->piVars['tt_category_mm']['categorytitle']) . "> ";
			$markerArray['###CATEGORYVALUE2###'] = $this->getFirstCatgoryname($this->piVars['tt_category_mm']['categorytitle']) . " > ";
		}
		else{
			$firstCategory = $this->getFirstCatgoryname($this->piVars['tt_category_mm']['categorytitle']);
			$markerArray['###CATEGORYVALUE2###'] = $this->getFirstCatgoryname($this->piVars['tt_category_mm']['categorytitle']);
		}

		if(!empty($this->piVars['tt_address']['tx_spdirectory_cat'])){
			$secondCategory = $this->getCatgoryname($this->piVars['tt_category_mm']['catname']) . " > ";
			$markerArray['###CATEGORYVALUE1###'] = $this->getCatgoryname($this->piVars['tt_category_mm']['catname']) . " > ";
		}
		else{
			$secondCategory = $this->getCatgoryname($this->piVars['tt_category_mm']['catname']);
			$markerArray['###CATEGORYVALUE1###'] = $this->getCatgoryname($this->piVars['tt_category_mm']['catname']);
		}


		$thirdCategory = $this->getCatgoryname($this->piVars['tt_address']['tx_spdirectory_cat']);

		$this->pdfCategory = $firstCategory . $secondCategory . $thirdCategory;

		$element = $this->piVars['tt_address']['tx_spdirectory_cat'];
		$category = $this->getCatgoryname($element);
		$markerArray['###L###'] = $this->L ;
		$markerArray['###SITE_URL###'] = $this->siteUrl ;
		$markerArray['###BACKPID###'] = $this->gpVar['backPid'] ;
		$markerArray['###PID###'] =    $this->categoryId;
		$markerArray['###EXT_KEY###'] = $this->prefixId ;
		$markerArray['###ACTION###'] = $this->extKey."_".$this->action;
		$markerArray['###TIMESTAMP###'] = time();
		$markerArray['###FORM_ACTION###'] = '';
		$markerArray['###IMAGE_PATH###'] = $this->showImage;
		$markerArray['###FIRSTLEVEL###'] = $this->outputJs();
		$markerArray['###SECONDLEVEL###'] = $this->secondLevel;


		$markerArray['###CATEGORYVALUE###'] = $this->getCatgoryname($this->piVars['tt_address']['tx_spdirectory_cat']);

        $urlparams= array('action'=>'pdf','pdfUid'=> $this->pdfUid,'category'=>htmlspecialchars($this->pdfCategory));
		 
		$markerArray['###PDF###'] = $this->getUrl($urlparams);
		$markerArray['###PDFIMAGE###'] = $this->siteUrl.'typo3conf/ext/sm_enquiry/res/image/pdf.jpeg';
		foreach($this->localLang[$key] as $markerKey=>$markerVal){
			if ($withHash){
				$markerArray['###'. strtoupper($key.'.'.$markerKey).'###' ] = $markerVal;
			}else{
				$markerArray[ strtoupper($key.'.'.$markerKey) ] = $markerVal;
			}
		}
		return $markerArray;
	}


	function getjs(){
		$url = $this->getUrl(array("action"=>"ajax"));
		$getjs = "<script type='text/javascript' src='typo3conf/ext/sm_enquiry/pi1/js/ajax.js'></script>
<script type='text/javascript'>

 function getfirstcategory() {
			
			
			var url = '$url';
			var params = 'uid=' + $('categorytitle').value;
			var ajax = new Ajax.Updater(
					{success: 'secondlevel'},	
					url, {method: 'get', parameters: params, onFailure: reportError}
					);				
			
		 }
		 function getsecondcategory() {
			
			
			var url = '$url';
			var params = 'cid=' + $('catname').value;
			var ajax = new Ajax.Updater(
					{success: 'thirdlevel'},	
					url, {method: 'get', parameters: params, onFailure: reportError}
					);					
			
		 }
		 function reportError(request) {
			$('zipResult') = 'Error';
		 }
		 
	   function valforms(frm,itm) {
	 
		var i;
		var j;
		for (j=0;j < document.forms.length; j++ ) {
			 if (frm && document.forms[j]!=frm) continue; 
			 for (i=0;i < document.forms[j].length; i++ ) {  
			 	 if (itm && document.forms[j].elements[i] != itm) continue; 
			 	  var editstr = document.forms[j].elements[i].getAttribute('editcheck');
			 	   if ((editstr) && (editstr.length>0)) {
			 	   	// break up edit string into command     
				         var cmds = editstr.split(';');
				         var fld = document.forms[j].elements[i];
				         for (var k=0;k< cmds.length; k++ ) {
				         	var cmdarr = cmds[k].split('=');
				             cmdarr[0] = cmdarr[0].toLowerCase();
				          
				             var msg=''
				             if (cmdarr.length>2) 
				                msg=cmdarr[2];
				
				             switch (cmdarr[0]) {
							
				                case 'req' : 
				                 if ((cmdarr.length==1)||(cmdarr.length>1 && cmdarr[1].toUpperCase().charAt(0)=='Y')) {
				                 	  if (fld.value.replace(/\s/g,'')=='' || fld.value=='0'){
				                 	  	 if (!msg || !msg.length )
                               				msg=fld.name.toUpperCase().replace(/_/g,' ') + ' is required!';
                      					    window.alert(msg);
					   		                fld.focus();
					                     return false;
				                 	  }
				                 }
				                
				                break;
				                
				                case 'type' : 
				                	
                  					 switch (cmdarr[1].toLowerCase()) {
	                  					
                  					 	 case 'alpha':  
					                         if(fld.value.length>0 && fld.value.search('[^A-Z a-z]') >= 0) { 
					                              if (!msg || !msg.length)
					                                 msg = 'Only alphabetic characters allowed!';
						                              window.alert(msg);
						                              fld.focus();
						                              fld.select();
						                              return false;
					                         }//if  
				                    
                  					 
                  					     break;
                  					     
                  					     case 'email': 
                  					     	   var re = /^[ ]*\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+[ ]*$/;
					                           if (fld.value.length>0) {
					                          //  var emailArray = fld.value.split(',');
					                             // if (emailArray.length > 0) {
					                              // for(i=0;i < emailArray.length;i++) {
					                                  if (fld.value != fld.value.replace(/^\s+/g,'').replace(/\s+$/g,'')) {
					                                    fld.value = fld.value.replace(/^\s+/g,'').replace(/\s+$/g,'');
					                                  }
					                                  if (fld.value.length>0 && re.test(fld.value) == false) {
					                                    if (!msg || !msg.length)
					                                       msg = 'Email isnot a valid email address!';
					                                       window.alert(msg);
					                                       fld.focus();
					                                       fld.select();
					                                       return false;
					                                  }                                 
					                              // }
					                              //}
					                           }
					                       break;
					                       
					                     case 'int' : 
					                           if (fld.value.length>0 && (isNaN(fld.value))||(fld.value.indexOf('.')>0)){
					                              if (!msg || !msg.length)
					                                 msg = fld.name.toUpperCase().replace(/_/g,' ') + ' should be an integer!';
					                              window.alert(msg);
					                              fld.focus();
					                              fld.select();
					                              return false;
					                           } // if
					                           break;
					                           
					                     case 'pin' : 
         	
					                           var re = /(^[ ]*[0-9]{1,}[ ]*[-]*[A-Z a-z 0-9]{1,}$)/;
					                           if (fld.value.length>0 && re.test(fld.value) == false) {
					                              if (!msg || !msg.length)
					                                  msg = 'Not a valid pin code!';
						                              window.alert(msg);
						                              fld.focus();
						                              fld.select();
						                              return false;
					                           }
					                    break; // case pin
                  					     
                  					     
                  					 }
                  					 
                  					 break;
				                
				                default:
				                
				                break;
				         }
				                 	  }
							 	   
			 	   }			 
			 }
		}
	}
		</script>";

		return $getjs;

	}



	function getUid(){
		if(isset($_GET['cid'])) {
			
			$condthird  = "uid = '".$_GET['cid']."'";
			$order= "";
			$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('pid,uid',
			'tx_spdirectory_cat',$condthird,$order,'','','');
			$pId = $rows[0]['pid'];
			
			$cond  = "pid = '".$pId."' and tx_msitespdhier_parent = ".$_GET['cid'];
			echo '<select id="secondcatname" name="'.$this->prefixId.'[tt_address][tx_spdirectory_cat]">';
		}else
		if(isset($_GET['uid'])) {
			$condSec  = "uid = '".$_GET['uid']."'";
			$order= "";
			$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('pid,uid',
			'tx_spdirectory_cat',$condSec,$order,'','','');
			$pId = $rows[0]['pid'];
			
			$cond  = "pid = '".$pId."' and tx_msitespdhier_parent = ".$_GET['uid'];
			echo '<select id="catname" name="'.$this->prefixId.'[tt_category_mm][catname]" onchange="getsecondcategory(this)">';
		}

		$order= "catname";
		$i=0;
		$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('pid,uid,catname',
		'tx_spdirectory_cat',$cond,$order,'','','');



		foreach($rows as $key=>$value){
			$i=1;
			$data['uid']=$value['uid'];
			$data['pid']=$value['pid'];
			$data['catname']=$value['catname'];
			echo '<option value="'.$data['uid'].'">'.$data['catname'].'</option>';


		}

		if($i==0){
			echo '<option value="">Not Available</option>';
		}





		echo "</select>";
		die();

	}
	
	
	function getPDF($val,$condValue,$cat){
		if(empty($catValue)){
			$catValue = $_GET['category'];
		}
		
		if(empty($_GET['category'])){
			$catValue = $cat;
		}

		$pdf=new UFPDF();
		$pdf->AddPage();

		if(empty($condValue)){

			$cond  = "uid =".$_GET['pdfUid'];
		}
		else{

			$cond = "uid =".$condValue;
		}
	
	
		$order= "";
		$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('name,title,email,company,address,zip,city,country,image,phone,mobile,fax','tt_address', $cond,$order,'','','');


		$pdf->SetX(20);
		$pdf->SetY(20);
		$pdf->SetFont('Arial','',10);
               
		$pdf->Cell(40,4,'',0,1);
		$pdf->Cell(40,4,'',0,1);
		$pdf->Cell(40,4,'',0,1);
		$pdf->Cell(40,4,'',0,1);
		$pdf->Cell(40,4,'',0,1);
		$pdf->Cell(40,4,'',0,1);
		$pdf->Cell(40,4,'',0,1);  

		$pdf->Cell(40,4,'',0,1);  
		$pdf->Cell(40,4,'',0,1);  
		$pdf->Cell(40,4,'',0,1);  


		$pdf->Cell(40,4,'',0,1);  
		$pdf->Cell(40,4,'',0,1);  		

     	
     		
     		veröffentlicht):',0,1);
		/*$pdf->SetFont('Arial','',10);
		$pdf->MultiCell(50,10,'fghdhdf',0,L);*/
		$pdf->Cell(40,10,'',0,0);
		$pdf->Cell(40,4,'',0,1);
		if (is_array($rows[0])) {

			foreach($rows[0] as $key=>$value) {
				if($key != "image"){
					$pdf->Cell(40,4,ucfirst($key),0,L);
					$pdf->MultiCell(50,4,$value,0,L);

				}

			}
	
			$pdf->Cell(40,4,ucfirst('Category'),0,L);
			$pdf->MultiCell(50,4,$catValue,0,L);

		}
		
     	    $pdf->Cell(40,10,'Datensatz*, der veröffentlicht wird:',0,1);

	    
	    $pdf->Cell(40,4,'',0,1); 
	    $pdf->Cell(40,4,'',0,1); 
	    $pdf->Cell(40,4,'',0,1); 
	    $pdf->Cell(40,4,'',0,1); 
	    
    	    $pdf->Cell(40,4,'Ort, Datum: ___________________            Unterschrift:___________________',0,1);
	    if ($this->action=='pdf') {
		 $pdf->Output('form.pdf','D');
	    }else{
		    $pdf->Output($val);
	    } 

	}
	function sendMail(){		
		if(empty($this->email)){
			
			return '';
		}
		
		$fromMail = $this->senderEmail;
		$subject = $this->mailSubject;		
		$fromName = $this->senderEmail;
		$message = 	$this->mailMessage;
		$toEMail = "$this->adminEmail,$this->email";
		$attachment = PATH_site.'typo3conf/ext/form.pdf';


		$htmlmail = t3lib_div::makeInstance('t3lib_htmlmail');
		$htmlmail->start();
		
		$htmlmail->subject = $subject;
		$htmlmail->from_email = $fromMail;
		$htmlmail->CharSet = "UTF-8";
		$htmlmail->from_name = $fromName;
		$htmlmail->replyto_email = $htmlmail->from_email;
		$htmlmail->replyto_name = $htmlmail->from_name;
		$htmlmail->addAttachment($attachment);
		$htmlmail->addPlain($message);
		$htmlmail->setHeaders();
		$htmlmail->setContent();
		$htmlmail->setRecipient(explode(',', $toEMail));
		$htmlmail->sendTheMail();

	}



}

if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/sm_enquiry/pi1/class.tx_smenquiry_pi1.php'])	{
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/sm_enquiry/pi1/class.tx_smenquiry_pi1.php']);
}

?>
mike_sebaro ·

ja nur wo find ich das? hab alle dateien durchsucht. ne idee?
kann das sein das das woanders und nicht bei den dateien die bei der extension dabei sind definiert ist?

laser ·

$this->mailMessage ist eine Klassenvariable.

In Zeile 229 wird diese gesetzt:

$this->mailMessage = ($this->conf['MessageBody']) ? $this->conf['MessageBody'] : "Account Registered";

Dabei wird auf die Variable 'MessageBody' im Setup oder in den Constants zugegriffen. Ist diese Variable leer, wird "Account registered" eingefügt.

In Zeile 753 wird der Text zugewiesen und in 772 die E-Mail verschickt.