Post by BigBrother » Tue Jun 30, 2009 4:43 pm

Nicht jeder möchte die Newsletter im HTML-Format versenden, darum sende ich meine Newsletter nur noch im TEXT-Format.

Hier einmal eine Anleitung zum Versenden der Newsletter im Textformat.

Gehe zu admin/view/template/customer/mail.tpl

Suche nach

Code: Select all

if ($emails) {
            $message  = '<html dir="ltr" lang="en">' . "\n";
            $message .= '<head>' . "\n";
            $message .= '<title>' . $this->request->post['subject'] . '</title>' . "\n";
            $message .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' . "\n";
            $message .= '</head>' . "\n";
            $message .= '<body>' . htmlspecialchars_decode($this->request->post['message']) . '</body>' . "\n";
            $message .= '</html>' . "\n";
            

foreach ($emails as $email) {
               $mail = new Mail();   
               $mail->setTo($email);
               $mail->setFrom($this->config->get('config_email'));
                $mail->setSender($this->config->get('config_store'));
                $mail->setSubject($this->request->post['subject']);
               $mail->setHtml($message);
                $mail->send();
            }
         }
Ersetze :

Code: Select all

if ($emails) {
            $message = $this->request->post['subject']  . "\n";
            $message = htmlspecialchars_decode($this->request->post['message']) . "\n";
            
            

foreach ($emails as $email) {
               $mail = new Mail();   
               $mail->setTo($email);
               $mail->setFrom($this->config->get('config_email'));
                $mail->setSender($this->config->get('config_store'));
                $mail->setSubject($this->request->post['subject']);
               $mail->settext($message);
   }
         }

WICHTIG!

Der fckeditor schreibt immer im HTML-Format und darum müssen wir ihn ersetzen.

Suche in

admin/view/template/customer/mail.tpl

Code: Select all

<tr>
        <td><span class="required">*</span> <?php echo $entry_message; ?></td>
        <td><textarea name="message" id="message"><?php echo $message; ?></textarea>
          <?php if ($error_message) { ?>
          <span class="error"><?php echo $error_message; ?></span>
          <?php } ?></td>
      </tr>
    </table>
  </div>
</form>
<script type="text/javascript" src="view/javascript/fckeditor/fckeditor.js"></script>
<script type="text/javascript"><!--
var sBasePath           = document.location.href.replace(/index\.php.*/, 'view/javascript/fckeditor/');
var oFCKeditor          = new FCKeditor('message');
	oFCKeditor.BasePath = sBasePath;
	oFCKeditor.Value	= document.getElementById('message').value;
	oFCKeditor.Width    = '100%';
	oFCKeditor.Height   = '300';
	oFCKeditor.ReplaceTextarea();
//--></script>

Ersetze

Code: Select all

      <tr>
        <td><span class="required">*</span> <?php echo $entry_message; ?></td>
        <td><textarea name="message" id="message" cols="65" rows="10"><?php echo $message; ?></textarea>
          <?php if ($error_message) { ?>
          <span class="error"><?php echo $error_message; ?></span>
          <?php } ?></td>
      </tr>
    </table>
  </div>
</form>
Das war alles!

Danke an Alle hier im Forum, die mich so tatkräftig unterstützen, bei all den offenen Fragen *grummel* 8)
Toller Support :(

Selbst ist der Mann!

New member

Posts

Joined
Fri Jun 19, 2009 12:14 am
Who is online

Users browsing this forum: No registered users and 14 guests