Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function subscribe_finish($mail = 'default@domain.com', $name = 'Suhendra') {
- $email_body = "Subscriber Finished <br/>Thank you.";
- $options["unsubscribe"] = FALSE;
- $options["unsubscribe_link"] = "";
- $options["sender_email"] = "SenderEmail@domain.com";
- $options["sender_name"] = "Sender Name";
- $options["name"] = $name;
- $options["destinations_email"] = $mail;
- $options["email_subject"] = " Subscribe Finished";
- $options["message"] = $email_body;
- $options["template"] = "guest-book-template";
- return $options;
- }
- function subscribe_verify_content($mail = 'default@domain.com', $code = '!@#$%^&*7654%^&*') {
- $email_body = "Please verify your email address below.";
- $email_body .= "<br/>";
- $email_body .= '<a target="_blank" href="' . site_url("registration/subscribe") . '?mail-subscriber=' . $mail . '&activation-code=' . $code . '"><b>Verify ' . $mail . '</b></a>';
- $email_body .= '<br/><em>if you can\'t see link above copy and paste URL in your browser below. </em>';
- $email_body .= site_url("registration/subscribe") . '?mail-subscriber=' . $mail . '&activation-code=' . $code;
- $options["unsubscribe"] = FALSE;
- $options["unsubscribe_link"] = "";
- $options["sender_email"] = "SenderEmail@domain.com";
- $options["sender_name"] = "Sender Name";
- $options["name"] = $mail;
- $options["destinations_email"] = $mail;
- $options["email_subject"] = " Subscribe Confirmation";
- $options["message"] = $email_body;
- $options["template"] = "guest-book-template";
- return $options;
- }
- function sendmail($options = NULL) {
- $ci = & get_instance();
- $ci->load->library('email');
- $config['charset'] = 'utf-8';
- $config['wordwrap'] = TRUE;
- $config['mailtype'] = 'html';
- $config['validate'] = TRUE;
- $config['priority'] = 1;
- $config['useragent'] = "MY Agent Mailer";
- $config['protocol'] = "Email Protocol";
- $config['smtp_host'] = "Email Host";
- $config['smtp_user'] = "SMTP User as Sender Email";
- $config['smtp_pass'] = "SMTP Password";
- $config['smtp_port'] = "SMTP Port";
- $ci->email->initialize($config);
- $ci->email->set_newline("\r\n");
- $ci->email->from($options["sender_email"], $options["sender_name"]);
- $ci->email->to($options["destinations_email"]);
- if (array_key_exists("cc_email", $options)) {
- $ci->email->cc($options["cc_email"]);
- }
- if (array_key_exists("bcc_email", $options)) {
- $ci->email->cc($options["bcc_email"]);
- }
- $ci->email->subject($options["email_subject"]);
- $template = "default";
- $message = $options["message"];
- $options["name"] = $options["name"];
- $options["subject"] = "Thank you";
- if (array_key_exists("template", $options)) {
- $template = $options["template"];
- $message = $ci->load->view("path/to/email/layout/file" . $template, $options, TRUE);
- }
- $ci->email->message($message);
- if (!$ci->email->send()) {
- $result = FALSE;
- } else {
- $result = TRUE;
- }
- return $result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement