Beispiel #1
0
Datei: Mail.php Projekt: rjha/sc
 static function newAccountMail($name, $email)
 {
     $templates = \com\indigloo\sc\html\Mail::getNewAccount($name);
     $text = $templates["text"];
     $html = $templates["html"];
     $subject = Config::getInstance()->get_value("new.account.subject");
     $from = Config::getInstance()->get_value("default.mail.address");
     $fromName = Config::getInstance()->get_value("default.mail.name");
     $tos = array($email);
     $code = \com\indigloo\mail\SendGrid::sendViaWeb($tos, $from, $fromName, $subject, $text, $html);
     return $code;
 }
Beispiel #2
0
#!/usr/bin/php
<?php 
include 'sc-app.inc';
include APP_CLASS_LOADER;
include WEBGLOO_LIB_ROOT . '/com/indigloo/error.inc';
use com\indigloo\mysql as MySQL;
use com\indigloo\Logger;
use com\indigloo\Configuration as Config;
set_exception_handler('offline_exception_handler');
$lines = file('/home/rjha/cron/query.log');
$tokens = array();
foreach ($lines as $line) {
    $pieces = explode(" ", $line);
    $entity = $pieces[10];
    $token = $pieces[11];
    if (!in_array($token, $tokens)) {
        array_push($tokens, $token);
    }
}
//mail these tokens
$templates = \com\indigloo\sc\html\Mail::getSearchTokens($tokens);
$text = $templates['text'];
$html = $templates['html'];
$subject = " what people searched on 3mik today";
$from = Config::getInstance()->get_value("default.mail.address");
$fromName = Config::getInstance()->get_value("default.mail.name");
$tos = array("*****@*****.**", "*****@*****.**");
\com\indigloo\mail\SendGrid::sendViaWeb($tos, $from, $fromName, $subject, $text, $html);