Page 1 of 1

Opencart 1.5.6.4 review link email notification

Posted: Wed Mar 28, 2018 10:25 pm
by nobreak
Hi. When someone writes a review, I receive an email message that someone has written a review. The problem is that there is only a message without a link to the product for which the review is written. Is it possible to include in the message the product link?
Thanks!

Re: Opencart 1.5.6.4 review link email notification

Posted: Thu Mar 29, 2018 1:16 am
by IP_CAM
tried this already ?
Ernie
---
Admin Notification and Shortcut free. OC v.1.5.5 - 1.5.6.4:
https://www.opencart.com/index.php?rout ... n_id=23872
Image

Re: Opencart 1.5.6.4 review link email notification

Posted: Thu Mar 29, 2018 2:28 pm
by nobreak
IP_CAM wrote:
Thu Mar 29, 2018 1:16 am
tried this already ?
Ernie
---
Admin Notification and Shortcut free. OC v.1.5.5 - 1.5.6.4:
https://www.opencart.com/index.php?rout ... n_id=23872
Image
This only gives the link in the administrative. I need when someone write a review, to get email with link to the product to which it is written....

Re: Opencart 1.5.6.4 review link email notification

Posted: Thu Mar 29, 2018 6:42 pm
by straightlight
Better use the re-captcha with CSRF extension if considering to send notification emails per review replies as webservers are limiting the mount of emails on an everyday basis. Another way to do it would also be by creating a cron task with a queue list so to avoid on flooding the server requests with emails.

Re: Opencart 1.5.6.4 review link email notification

Posted: Thu Mar 29, 2018 7:03 pm
by nobreak
This is from catalog/controler/product/product.php. I think magic is here :) Вhat do I add to get a product link in the message?

Code: Select all

public function write() {
		$this->language->load('product/product');

		$this->load->model('catalog/review');

		$json = array();

		if ($this->request->server['REQUEST_METHOD'] == 'POST') {
			if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 25)) {
				$json['error'] = $this->language->get('error_name');
			}
			
			if (!is_numeric($this->request->post['number'])) {
				$json['error'] = $this->language->get('error_number');
			}
			
			if ((utf8_strlen($this->request->post['text']) < 25) || (utf8_strlen($this->request->post['text']) > 1000)) {
				$json['error'] = $this->language->get('error_text');
			}
			
			if ((utf8_strlen($this->request->post['email']) > 96) || !preg_match('/^[^\@]+@.*\.[a-z]{2,6}$/i', $this->request->post['email'])) {
				$json['error'] = $this->language->get('error_email');
			}

			if (empty($this->session->data['captcha']) || ($this->session->data['captcha'] != $this->request->post['captcha'])) {
				$json['error'] = $this->language->get('error_captcha');
			}

			if (!isset($json['error'])) {
				$this->model_catalog_review->addReview($this->request->get['product_id'], $this->request->post);
			
				
				$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->request->post['email']);
				$mail->setSender($this->request->post['name']);
				$mail->setSubject(html_entity_decode(sprintf($this->language->get('email_subject'), $this->request->post['name']), ENT_QUOTES, 'UTF-8'));
				$mail->setText(strip_tags(html_entity_decode($this->request->post['text'], ENT_QUOTES, 'UTF-8')));
				$mail->send();
				
				$json['success'] = $this->language->get('text_success');
			}
		}

		$this->response->setOutput(json_encode($json));
	}

Re: Opencart 1.5.6.4 review link email notification

Posted: Fri Mar 30, 2018 7:40 am
by IP_CAM
Well, this one should come close, it only misses the link itself:
---
Reviews Notification (vQmod)
Sends out an e-mail notification to the OpenCart administrator
when a customer submits a review. This mod has been converted
to a vQmod per this forum topic:
http://forum.opencart.com/viewtopic.php?f=23&t=5647
---
https://www.opencart.com/index.php?rout ... on_id=4828
---
And this one has everything you need:
Advanced Customer Reviews with Email, URL & Auto-Enable
https://www.opencart.com/index.php?rout ... on_id=6645
---
and more on this can possibly found by searching here:
https://www.google.com/search?q=opencar ... +to+admin"
---
Good Luck!
Ernie
Image

Re: Opencart 1.5.6.4 review link email notification

Posted: Fri Mar 30, 2018 2:01 pm
by nobreak
IP_CAM wrote:
Fri Mar 30, 2018 7:40 am
Well, this one should come close, it only misses the link itself:
---
Reviews Notification (vQmod)
Sends out an e-mail notification to the OpenCart administrator
when a customer submits a review. This mod has been converted
to a vQmod per this forum topic:
http://forum.opencart.com/viewtopic.php?f=23&t=5647
---
https://www.opencart.com/index.php?rout ... on_id=4828
---
And this one has everything you need:
Advanced Customer Reviews with Email, URL & Auto-Enable
https://www.opencart.com/index.php?rout ... on_id=6645
---
and more on this can possibly found by searching here:
https://www.google.com/search?q=opencar ... +to+admin"
---
Good Luck!
Ernie
Image
The first one I tried, worked and sent the product title, but no link to it. When I use an additional module, I receive 2 messages because the system sends one. Then the question arises - how to stop the message from the default system?

Re: Opencart 1.5.6.4 review link email notification

Posted: Fri Mar 30, 2018 10:29 pm
by IP_CAM
what happen, if you change the Admin email settings ?
Ernie
Image

Re: Opencart 1.5.6.4 review link email notification

Posted: Mon Apr 02, 2018 2:12 pm
by nobreak
IP_CAM wrote:
Fri Mar 30, 2018 10:29 pm
what happen, if you change the Admin email settings ?
Ernie
Image
I have no problem with notification. The problem is that I do not have a product link in the notification....