I have a question. I would always send a text newsletter. Not as Html Mail. Under admin / controller / customer / Mail.php can I find the code. How do I change the code so that I always in the newsletter can send as text-Mail.
Thx 4 help.
Greetz
BigBrother
Go to admin/controller/customer/mail.php and view the code in that file.
I hope this helps.
I hope this helps.
http://www.alreadymade.com
Follow me on twitter.com/alreadymade
Hello redyman,
thx for your answer.
Yes, I have found the Php- code. But I do not know how I must change the code. Can someone help me?
admin/controller/customer/mail.php at line 37
I have change the code:
Is this code right?
Thanks for the help.
thx for your answer.
Yes, I have found the Php- code. But I do not know how I must change the code. Can someone help me?
admin/controller/customer/mail.php at line 37
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();
}
}
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);
$mail->send();
}
}
Thanks for the help.
Sorry, I assumed you knew php or just wanted to know where the files involved were... umm... this *should* work, I haven't tested it, but it looks ok.
The main problem here is that the content will still be html, even if you send it out as text... eg. if you bold some text, then you'll get the html tags as well. eg. <b>Your text</b>
You'd have to get rid of the visual editor as well... look at admin/view/template/customer/mail.tpl and replace all contents with this.
Hope this works.
The main problem here is that the content will still be html, even if you send it out as text... eg. if you bold some text, then you'll get the html tags as well. eg. <b>Your text</b>
You'd have to get rid of the visual editor as well... look at admin/view/template/customer/mail.tpl and replace all contents with this.
Code: Select all
<?php if ($error_warning) { ?>
<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<?php if ($success) { ?>
<div class="success"><?php echo $success; ?></div>
<?php } ?>
<div class="heading">
<h1><?php echo $heading_title; ?></h1>
<div class="buttons"><a onclick="$('#form').submit();" class="button"><span class="button_left button_send"></span><span class="button_middle"><?php echo $button_send; ?></span><span class="button_right"></span></a><a onclick="location='<?php echo $cancel; ?>';" class="button"><span class="button_left button_cancel"></span><span class="button_middle"><?php echo $button_cancel; ?></span><span class="button_right"></span></a></div>
</div>
<div class="tabs"><a tab="#tab_general"><?php echo $tab_general; ?></a></div>
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
<div id="tab_general" class="page">
<table class="form">
<tr>
<td width="25%"><?php echo $entry_to; ?></td>
<td><select name="to">
<?php if ($to == 'newsletter') { ?>
<option value="newsletter" selected="selected"><?php echo $text_newsletter; ?></option>
<?php } else { ?>
<option value="newsletter"><?php echo $text_newsletter; ?></option>
<?php } ?>
<?php if ($to == 'customer') { ?>
<option value="customer" selected="selected"><?php echo $text_customer; ?></option>
<?php } else { ?>
<option value="customer"><?php echo $text_customer; ?></option>
<?php } ?>
<?php foreach ($customers as $customer) { ?>
<?php if ($customer['customer_id'] == $to) { ?>
<option value="<?php echo $customer['customer_id']; ?>" selected="selected"><?php echo $customer['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $customer['customer_id']; ?>"><?php echo $customer['name']; ?></option>
<?php } ?>
<?php } ?>
</select></td>
</tr>
<tr>
<td><span class="required">*</span> <?php echo $entry_subject; ?></td>
<td><input name="subject" value="<?php echo $subject; ?>" />
<br />
<?php if ($error_subject) { ?>
<span class="error"><?php echo $error_subject; ?></span>
<?php } ?></td>
</tr>
<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>
<script type="text/javascript"><!--
$.tabs('.tabs a');
//--></script>
http://www.alreadymade.com
Follow me on twitter.com/alreadymade
I have an error, if i use the code.
:-(
The mail was sending but i get this notice!
admin/controller/customer/mail.php Line 58:
system/engine/controller.php Line 23
:-(
The mail was sending but i get this notice!
Code: Select all
Notice: Undefined variable: message in /homepages/xx/xxxx/htdocs/xxx/admin/controller/customer/mail.php on line 58
Warning: Cannot modify header information - headers already sent by (output started at /homepages/xx/xxxx/htdocs/xxx/admin/controller/customer/mail.php:58) in /homepages/xx/xxx7/htdocs/xxx/system/engine/controller.php on line 23
Code: Select all
$message .= $this->request->post['subject'] . "\n";
Code: Select all
header('Location: ' . html_entity_decode($url));
I'm so blind!!!
Here is the instructions for sending a text-mail as newsletter.
Go to admin/view/template/customer/mail.tpl
Search
Replace :
Important!!
fckeditor is writing in html tags.
Look at
admin/view/template/customer/mail.tpl
and search
Replace
Here is the instructions for sending a text-mail as newsletter.
Go to admin/view/template/customer/mail.tpl
Search
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();
}
}
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);
}
}
Important!!
fckeditor is writing in html tags.
Look at
admin/view/template/customer/mail.tpl
and search
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>
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>
Who is online
Users browsing this forum: No registered users and 34 guests