Emailing a wishlist 1.5.2.1
4 posts
• Page 1 of 1
Emailing a wishlist 1.5.2.1
Hello all, I have currently coded a few addin pages that allow a guest to view a customers wishlist if they choose to make it public. I was wondering if any of you know how to load the mail module and use it? I have been looking through stock controllers and haven't seen it called. I tried
- Code: Select all
$this->mail->setTo("email@email.com");
- Code: Select all
$this->mail->send();
- danasgarcia
- Posts: 2
- Joined: Fri Apr 20, 2012 1:02 am
Re: Emailing a wishlist 1.5.2.1
Here is an example of setting up mail. This example can either use a template...or just a text string to be echoed on the email.
Again, you will need to make sure certain variables are filled such as recipient email, subject, and so on and so forth. This will work for you.
- Code: Select all
$template = new Template();
$template->data['order_id'] = $order_id;
$text = "YOUR TEXT OR VARIABLE";
//LOCATION OF YOUR HTML TEMPLATE
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/order.tpl')) {
$html = $template->fetch($this->config->get('config_template') . '/template/mail/order.tpl');
} else {
$html = $template->fetch('default/template/mail/order.tpl');
}
$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($order_info['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($order_info['store_name']);
$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
//IF YOU ARE NOT USING A TEMPLATE MAKE SURE TO COMMENT OUT THE LINE BELOW
$mail->setHtml($html);
////////////////////////
$mail->setText(html_entity_decode($text, ENT_QUOTES, 'UTF-8'));
$mail->send();
Again, you will need to make sure certain variables are filled such as recipient email, subject, and so on and so forth. This will work for you.
-

avvici -arvixe- - Posts: 4338
- Joined: Tue Apr 05, 2011 4:09 am
- Location: Charlotte, NC
Re: Emailing a wishlist 1.5.2.1
Thank you so much, I appreciate your help. I didn't even think to just initialize it as an object.
- danasgarcia
- Posts: 2
- Joined: Fri Apr 20, 2012 1:02 am
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 13 guests
















