Post by toolsandtimber » Fri Mar 23, 2012 4:45 pm

Thank you! I can confirm thsi works with opencart 1.5.1.3

Life saver!!!!

New member

Posts

Joined
Wed Nov 23, 2011 5:47 pm

Post by Avvici » Sat May 26, 2012 1:23 pm

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
lol . Just how much does a beer in London cost?

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by gocreative » Fri Jun 14, 2013 9:22 am

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

Code: Select all

		$this->response->setOutput($this->render());
After it, insert:

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();
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?

User avatar
Active Member

Posts

Joined
Tue Jan 12, 2010 5:46 pm

Post by santura » Sat Jun 22, 2013 3:49 pm

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

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()");
And Insert after

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.

New member

Posts

Joined
Fri Jun 14, 2013 8:33 pm

Post by gocreative » Sun Jun 23, 2013 7:49 am

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.

User avatar
Active Member

Posts

Joined
Tue Jan 12, 2010 5:46 pm

Post by santura » Mon Jun 24, 2013 11:52 pm

I'm not using an invalid SMTP port, my hosting provider uses a unique port.

I think we just need a fix that works with 1.5.5.1

Can anyone help?

New member

Posts

Joined
Fri Jun 14, 2013 8:33 pm

Post by santura » Wed Jun 26, 2013 1:16 pm

Got the new affiliate email to admin working in 1.5.5.1

in file catalog\controller\affiliate\success.php

find

Code: Select all

$this->response->setOutput($this->render());
insert after

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();

New member

Posts

Joined
Fri Jun 14, 2013 8:33 pm

Post by gocreative » Wed Jun 26, 2013 1:50 pm

That's what I tried previously, without luck unfortunately.

User avatar
Active Member

Posts

Joined
Tue Jan 12, 2010 5:46 pm

Post by santura » Wed Jun 26, 2013 1:54 pm

It's slightly different code. Did you try it? This code worked for me where the previous code posted didn't.

New member

Posts

Joined
Fri Jun 14, 2013 8:33 pm

Post by gocreative » Wed Jun 26, 2013 2:00 pm

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?

User avatar
Active Member

Posts

Joined
Tue Jan 12, 2010 5:46 pm

Post by santura » Wed Jun 26, 2013 2:19 pm

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.

New member

Posts

Joined
Fri Jun 14, 2013 8:33 pm

Post by gocreative » Wed Jun 26, 2013 2:31 pm

Good idea. I'll copy the contact form code and see how that goes.

User avatar
Active Member

Posts

Joined
Tue Jan 12, 2010 5:46 pm

Post by Booya » Fri Oct 18, 2013 2:06 am

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
Chris, (or anyone)

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'));
       }

Newbie

Posts

Joined
Tue Aug 07, 2012 7:19 am
Who is online

Users browsing this forum: No registered users and 193 guests