Re: [TYPO3-german] Template-Email aus custom Form-Handler-Finischer versenden

2014-11-30 Diskussionsfäden Nicolas Puente

Hallo, ich habe deine Antwort gerade gesehen. So habe ich benutzt:

/**
 * @param array $recipient recipient of the email in the format 
array('recipi...@domain.tld' => 'Recipient Name')
 * @param array $sender sender of the email in the format 
array('sen...@domain.tld' => 'Sender Name')

 * @param string $subject subject of the email
 * @param string $templateName template name (UpperCamelCase)
 * @param array $variables variables to be passed to the Fluid view
 * @return boolean TRUE on success, otherwise false
*/
protected function sendTemplateEmail(array $recipient, array 
$sender, $subject, $templateName, array $variables = array()) {
//$currentContentObject = 
$this->configurationManager->getContentObject()->data;

/** @var \TYPO3\CMS\Fluid\View\StandaloneView $emailView */
$emailView = 
$this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView');


$extbaseFrameworkConfiguration = 
$this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
$templateRootPath = 
\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($extbaseFrameworkConfiguration['view']['templateRootPath']);
$templatePathAndFilename = $templateRootPath . 'Mailseden/' . 
$templateName . '.html';


$this->view->setTemplatePathAndFilename($templatePathAndFilename);

$this->view->assignMultiple($variables);
$emailBody = $this->view->render();

/** @var $message \TYPO3\CMS\Core\Mail\MailMessage */
$message = 
$this->objectManager->get('TYPO3\\CMS\\Core\\Mail\\MailMessage');

$message->setTo($recipient)
  ->setFrom($sender)
  ->setSubject($subject);

 // Possible attachments here
//foreach ($attachments as $attachment) {
// $message->attach(\Swift_Attachment::fromPath($attachment));
//}

// Plain text example
#$message->setBody($emailBody, 'text/plain');

// HTML Email
$message->setBody($emailBody, 'text/html');

$message->send();
return $message->isSent();
}


// E-Mail zum Bestellungs beareiter
$thereturn = 
$this->sendTemplateEmail(array($this->settings['flexForm']['e_mailBer'] 
=> 'Recipient Name'), array($this->settings['flexForm']['e_mailBer'] => 
'Sender Name'), 'Bestellung', 'Bestellung', array('someVariable' => 'Foo 
Bar'));



\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($thereturn, 
'thereturn');


// Zum andere bearbeiter
if($this->settings['flexForm']['e_mailLeit']){
$thereturn = 
$this->sendTemplateEmail(array($this->settings['flexForm']['e_mailLeit'] 
=> 'Recipient Name'), array($this->settings['flexForm']['e_mailLeit'] => 
'Sender Name'), 'Bestellung', 'Bestellung', array('someVariable' => 'Foo 
Bar'));
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($thereturn, 
'thereturn');

}

// E-Mail zum Kunde
$thereturn = 
$this->sendTemplateEmail(array($this->settings['flexForm']['e_mailBer'] 
=> 'Recipient Name'), array($this->settings['flexForm']['e_mailBer'] => 
'Sender Name'), $this->settings['flexForm']['e_betreff'], 'List', 
array('someVariable' => 'Foo Bar'));
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($thereturn, 
'thereturn');


Ich überschreibe das Template im kontroller im jede anruft!! : 
$this->view->setTemplatePathAndFilename($templatePathAndFilename);


Dann habe ich kein Problem mehr.

Viel Grüße

Nicolas



___
TYPO3-german mailing list
TYPO3-german@lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german

[TYPO3-german] CE "Nur Bilder" - Abstände

2014-11-30 Diskussionsfäden Peter Kühnlein

Guten Morgen Liste,

ich habe ein Problem, das ich eigentlich als "Anfänger-Problem" sehe, 
aber ich stehe gerade im Wald - auch Suchen im Web hat nicht geholfen.


Ich habe eine Site, mit CSC gestyled. Auf einer der Seiten habe ich ein 
CE "Nur Bilder", in dem drei Bilder nebeneinander landen sollen. Eines 
ganz links, eines ganz rechts, das dritte in der Mitte, jeweils mit 
einer caption darunter. Ganz einfach: float nach links, float nach 
rechts, und beim mittleren die seitlichen margins auf auto - denkt man. 
Aber CSC funkt rein und setzt jede Menge wraps und starre Abstände. Die 
würde ich gerne los. Noch dazu, weil gleich als nächstes ein CE mit vier 
Bildern mit Captions kommen soll, bei dem ebenfalls gleiche (aber eben 
nicht starre) Abstände nötig sind.


Kann mich jemand in die richtige Richtung schubsen?

Danke für jede Hilfe,
Peter

--

http://function2form.net
http://peter-kuehnlein.net

"Whether speaking formally or informally, one should look his listener in the eye. A 
polite greeting is done at the beginning and finished. Speaking with downcast eyes is 
careless."
(Hagakure)

___
TYPO3-german mailing list
TYPO3-german@lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german