Exemplo n.º 1
0
function drupal_mail_wrapper($message)
{
    $mimeheaders = array();
    foreach ($message['headers'] as $name => $value) {
        $mimeheaders[] = $name . ': ' . mime_header_encode($value);
    }
    $mail = new CVWOEmail(YMCA_NOTIFICATION_EMAIL_FROM, mime_header_encode($message['subject']));
    $mail->setContent($message['body']);
    return $mail->sendImmediate($message['to']);
}
Exemplo n.º 2
0
// included in all copies or substantial portions of the Software.
//
// 2. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Email process
//
//require_once('cvwobase_queue.php');
require_once 'cvwobase_email.php';
//require_once('cvwobase_')
// check for command line arguments
if ($argc != 2) {
    die('Invalid arguments');
}
// name of email queue to process
$queuename = $argv[1];
$queue = new CVWOQueue($queuename);
// iterate between email batches
while ($data = $queue->pop()) {
    $email = new CVWOEmail();
    $email->setHeaders($data['data']['extraHeaders']);
    $email->setContent($data['data']['content']);
    $email->sendImmediate($data['data']['to'], false, $data['data']['cc'], $data['data']['bcc'], $data['data']['attachment'], $data['data']['by_uid']);
}
// completed processing queue