Post by nobreak » Wed Mar 28, 2018 10:25 pm

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!

New member

Posts

Joined
Wed Jul 02, 2014 3:23 pm

Post by IP_CAM » 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

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by nobreak » Thu Mar 29, 2018 2:28 pm

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....

New member

Posts

Joined
Wed Jul 02, 2014 3:23 pm

Post by straightlight » Thu Mar 29, 2018 6:42 pm

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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nobreak » Thu Mar 29, 2018 7:03 pm

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

New member

Posts

Joined
Wed Jul 02, 2014 3:23 pm

Post by IP_CAM » 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

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by nobreak » Fri Mar 30, 2018 2:01 pm

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?

New member

Posts

Joined
Wed Jul 02, 2014 3:23 pm

Post by IP_CAM » Fri Mar 30, 2018 10:29 pm

what happen, if you change the Admin email settings ?
Ernie
Image

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by nobreak » Mon Apr 02, 2018 2:12 pm

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....

New member

Posts

Joined
Wed Jul 02, 2014 3:23 pm
Who is online

Users browsing this forum: No registered users and 136 guests