OpenCart 🇺🇦

Схема

public mixed approve ( $affiliate_id )

Аргументы

Аргумент Возможный тип Описание
$affiliate_id

Описание

Метод пока еще не документирован.

Исходный код

$affiliate_info = $this->getAffiliate($affiliate_id);

if ($affiliate_info) {
	$this->db->query("UPDATE " . DB_PREFIX . "affiliate SET approved = '1' WHERE affiliate_id = '" . (int)$affiliate_id . "'");

	$this->language->load('mail/affiliate');

	$message  = sprintf($this->language->get('text_approve_welcome'), $this->config->get('config_name')) . "\n\n";
	$message .= $this->language->get('text_approve_login') . "\n";
	$message .= HTTP_CATALOG . 'index.php?route=affiliate/login' . "\n\n";
	$message .= $this->language->get('text_approve_services') . "\n\n";
	$message .= $this->language->get('text_approve_thanks') . "\n";
	$message .= $this->config->get('config_name');

	$mail = new Mail();
	$mail->protocol = $this->config->get('config_mail_protocol');
	$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($affiliate_info['email']);
	$mail->setFrom($this->config->get('config_email'));
	$mail->setSender($this->config->get('config_name'));
	$mail->setSubject(html_entity_decode(sprintf($this->language->get('text_approve_subject'), $this->config->get('config_name')), ENT_QUOTES, 'UTF-8'));
	$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
	$mail->send();
}