lol . Just how much does a beer in London cost?uksitebuilder wrote:For the price of a beer in London my extension does this and also adds alerts to the dashboard
see -> http://www.opencart.com/index.php?route ... order=DESC
Unfortunately this doesn't work for me. The affiliate notification emails are not received, and no errors are reported. Emails for new accounts and new orders are working fine. I'm using OC 1.5.5.1 with the SMTP protocol (the only method I can get to work with my host). Does anyone have any further suggestions?marcelwoo wrote:By the way, if you guys want to have email alerts for new affiliate account signed up waiting to be approved.
Do this:
open catalog\controller\affiliate\success.php
Find
After it, insert:Code: Select all
$this->response->setOutput($this->render());
Code: Select all
$message ="<strong>You have a new affiliate waiting to be approved.</strong><br><br>" .'<a href="http://www.YOURSITE.com/admin/">Login to review</a>'; $mail = new Mail(); $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); $mail->hostname = $this->config->get('config_smtp_host'); $mail->username = $this->config->get('config_smtp_username'); $mail->password = $this->config->get('config_smtp_password'); $mail->port = $this->config->get('config_smtp_port'); $mail->timeout = $this->config->get('config_smtp_timeout'); $mail->setTo($this->config->get('config_email')); $mail->setFrom("YOUREMAIL@YOURSITE.COM"); $mail->setSender("YOURSITE.com"); $mail->setSubject("An Affiliate Account Has Been Requested"); $mail->setHtml($message); $mail->send();
Did you work this out gocreative, I have exactly the same issue, also on 1.5.5.1 and using SMTP.
I did see an error though looks like it's not using SMTP
PHP Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
I was trying to add a review email as per below, but also need return requests and new affiliates
My contact form works fine.
Find this
And Insert after
I did see an error though looks like it's not using SMTP
PHP Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
I was trying to add a review email as per below, but also need return requests and new affiliates
My contact form works fine.
Find this
Code: Select all
$this->db->query("INSERT INTO " . DB_PREFIX . "review SET author = '" . $this->db->escape($data['name']) . "', customer_id = '" . (int)$this->customer->getId() . "', product_id = '" . (int)$product_id . "', text = '" . $this->db->escape($data['text']) . "', rating = '" . (int)$data['rating'] . "', date_added = NOW()");
Code: Select all
$this->load->model('catalog/product');
$product_info = $this->model_catalog_product->getProduct($product_id);
$message ="<strong>You have a new product review waiting.</strong><br><br>";
$message.='Product: '.$this->db->escape(strip_tags($product_info['name'])).'<br>';
$message.='Reviewer: '.$this->db->escape(strip_tags($data['name'])).'<br>';
$message.='Rating: '.$this->db->escape(strip_tags($data['rating'])).'<br><br>';
$message.='Text: <br>';
$message.=$this->db->escape(strip_tags($data['text']))."<br><br>";
$message.='<a href="'.$this->config->get('config_url').'/admin/index.php">Login to review</a>';
$mail = new Mail($this->config->get('config_mail_protocol'), $this->config->get('config_smtp_host'), $this->config->get('config_smtp_username'), html_entity_decode($this->config->get('config_smtp_password')), $this->config->get('config_smtp_port'), $this->config->get('config_smtp_timeout'));
$mail->setTo(array($this->config->get('config_email')));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject("Product Review");
$mail->setHtml($message);
$mail->send();
Last edited by santura on Wed Jun 26, 2013 2:09 pm, edited 1 time in total.
No solution yet, unfortunately. I don't receive any SMTP errors in my case, but it looks like with your site you may be using an invalid SMTP port.
Personally I think this issue is due to the content/composition of the emails being sent, because it's very odd that some messages work while others don't, even though the same mail settings have been configured. I'm not an expert in the area of email headers though, so I don't know how to diagnose/test that.
Personally I think this issue is due to the content/composition of the emails being sent, because it's very odd that some messages work while others don't, even though the same mail settings have been configured. I'm not an expert in the area of email headers though, so I don't know how to diagnose/test that.
Got the new affiliate email to admin working in 1.5.5.1
in file catalog\controller\affiliate\success.php
find
insert after
in file catalog\controller\affiliate\success.php
find
Code: Select all
$this->response->setOutput($this->render());
Code: Select all
$message ="<strong>You have a new affiliate waiting to be approved.</strong><br><br>".'<a href="http://www.YOURSITE.com/admin/">Login to review</a>';
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject("New Affiliate Signup");
$mail->setHtml($message);
$mail->send();
I've added it to the site but haven't tested it. The only change is that it's getting the "From" and "Sender" from the config instead of being manually added. Did you test it both ways?
Sorry you were right it does work both ways for me, sorry about the confusion it was the review email posted earlier that didn't work for me. I got that one working by copying the code from the contact form. If that helps, or maybe you have a different issue.
Chris, (or anyone)webpie it. wrote: Ok Mark your fixed file is above, copy that into your review.php
all i have done, which i should have done beofre is remove the [ highlight ][ /highlight ]
Rookie error pointed out by jcsmithy!! lol
Chris
I'm reviving this thread! I saw that you made some fixes here and based on what you put I updated my returns.php. Got a few errors, but ended up getting them fixed, however, I'm still not getting an email notification? Highly likely I've made a mistake somewhere but any help is much appreciated!
Here is how it looks now:
Code: Select all
public function insert() {
$this->language->load('account/return');
$this->load->model('account/return');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_account_return->addReturn($this->request->post);
$message ="<strong>You have a product return waiting.</strong><br><br>"
.'<a href="http://www.mtekweaponsystems.COM/supply/ADMIN">Login to review</a>';
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom("info@mtekdesign.net");
$mail->setSender("MWS Returns");
$mail->setSubject("A Return Has Been Requested");
$mail->setHtml($message);
$mail->send();
$this->redirect($this->url->link('account/return/success', '', 'SSL'));
}
Who is online
Users browsing this forum: No registered users and 193 guests