Example #1
0
$opt = getOptionFromCode($group_code);
// get prepop from code
$prepop = getPrepopFromCode($group_code);
if ($prepop == 'fill') {
    $box_value = htmlentities($email, ENT_QUOTES);
}
$box_display = 'block';
$box_hidden = false;
if ($prepop == 'yes-hidden') {
    $box_display = 'none';
    $box_hidden = true;
}
$wt = $treatment['warning_type'];
$warning_msg = $treatment['warning_msg'];
// get path to media file
$paths = get_media_path($songId);
$mediaPath = "";
if ($paths) {
    $mediaPath = $paths[0]["path"];
}
// enter your email address and click 'agree'  (opt = in, pop = no)
// click 'agree' (opt = in, pop = yes)
// click 'no thanks' to unsubscribe (opt = out)
if ($opt == 'out') {
    // the user needs to 'opt out' of the delivery system
    $button_text = 'Remove me from SafeDelivery';
    // set text for Details view
    $pre_text = 'You have been subscribed to the SafeDelivery service.';
    $details_start_text = "click 'No Thanks' to be removed from the SafeDelivery service";
    // user is subscribed, will need to opt out
    // $agreement_end_text = 'automatically charge your budget according to the Offer Details to the right';
Example #2
0
<?php

//This file sends email to someone through an external service (e.g. gmail)
include_once "config.php";
date_default_timezone_set("America/New_York");
require_once 'PHPMailerAutoload.php';
if (!isset($to)) {
    $to = '';
}
// if(!isset($songId))
// 	$songId=2;
// TODO: get dropbox_path for media
$mediaInfo = get_media_path($mediaId);
$mediaPath = $mediaInfo[0]['dropbox_path'];
// $attachment = $mediaPath;
$mail = new PHPMailer();
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 0;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
$mail->Host = 'smtp.gmail.com';
$body = "Thank you for choosing to receive your song through SafeDelivery! \n\t\tFollow the link below to your media file.\n\t\t" . $mediaPath . "\n\t\tEnjoy!";
$subject = 'SafeDelivery: Your song';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Username = SAFEDELIVERY_UNAME;