forked from science-ation/science-ation
- Replacement for PDF generation.
This commit is contained in:
parent
345729523e
commit
52b7580dcb
@ -219,12 +219,12 @@ case 'dialog_edit':
|
|||||||
<td class="input"><input type="text" name="description" size="60" value="<?=$description?>" /></td>
|
<td class="input"><input type="text" name="description" size="60" value="<?=$description?>" /></td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<tr><td colspan="2"><hr /></td>
|
<tr><td colspan="2"><hr /></td>
|
||||||
</tr><tr>
|
|
||||||
<td class="label"><?=i18n("Email Subject")?>:</td>
|
|
||||||
<td class="input"><input type="text" name="subject" size="60" value="<?=$subject?>" /></td>
|
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td class="label"><?=i18n("From Address")?>:</td>
|
<td class="label"><?=i18n("From Address")?>:</td>
|
||||||
<td class="input"><input type="text" name="from" size="60" value="<?=$from?>" /></td>
|
<td class="input"><input type="text" name="from" size="60" value="<?=$from?>" /></td>
|
||||||
|
</tr><tr>
|
||||||
|
<td class="label"><?=i18n("Email Subject")?>:</td>
|
||||||
|
<td class="input"><input type="text" name="subject" size="60" value="<?=$subject?>" /></td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td colspan="2" class="input">
|
<td colspan="2" class="input">
|
||||||
<table width="100%"><tr><td width="85%">
|
<table width="100%"><tr><td width="85%">
|
||||||
@ -233,10 +233,13 @@ case 'dialog_edit':
|
|||||||
</div>
|
</div>
|
||||||
</td><td width="15%">
|
</td><td width="15%">
|
||||||
<select name="insert_field" size="20" style="height:300" >
|
<select name="insert_field" size="20" style="height:300" >
|
||||||
<option value="FAIRNAME">[EMAIL]</option>
|
<option value="EMAIL">[EMAIL]</option>
|
||||||
<option value="FAIRNAME">[FAIRNAME]</option>
|
<option value="FAIRNAME">[FAIRNAME]</option>
|
||||||
<option value="FAIRNAME">[NAME]</option>
|
<option value="FIRSTNAME">[FIRSTNAME]</option>
|
||||||
<option value="FAIRNAME">[PASSWORD]</option>
|
<option value="LASTNAME">[LASTNAME]</option>
|
||||||
|
<option value="NAME">[NAME]</option>
|
||||||
|
<option value="PASSWORD">[PASSWORD]</option>
|
||||||
|
<option value="SALUTATION">[LASTNAME]</option>
|
||||||
</select>
|
</select>
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
|
|
||||||
|
@ -81,9 +81,8 @@ $q = mysql_query("SELECT * FROM emails WHERE fundraising_campaigns_id='$fcid' AN
|
|||||||
while($e = mysql_fetch_assoc($q)) {
|
while($e = mysql_fetch_assoc($q)) {
|
||||||
|
|
||||||
foreach($users as $uid=>&$u) {
|
foreach($users as $uid=>&$u) {
|
||||||
/* FIXME: do substitutions */
|
$subject = communication_replace_vars($e['subject'], $u);
|
||||||
$subject = $e['subject'];
|
$body = communication_replace_vars($e['bodyhtml'], $u);
|
||||||
$body = $e['bodyhtml'];
|
|
||||||
/* these dont' need substitutions */
|
/* these dont' need substitutions */
|
||||||
$to = $u['name'];
|
$to = $u['name'];
|
||||||
$date = date("F j, Y");
|
$date = date("F j, Y");
|
||||||
|
@ -873,6 +873,23 @@ function isEmailAddress($str) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function communication_replace_vars($text, &$u)
|
||||||
|
{
|
||||||
|
global $config;
|
||||||
|
$rep = array('FAIRNAME' => $config['fairname'],
|
||||||
|
'NAME' => $u['name'],
|
||||||
|
'EMAIL' => $u['email'],
|
||||||
|
'PASSWORD' => $u['password'],
|
||||||
|
'SALUTATION' => $u['salutation'],
|
||||||
|
'FIRSTNAME' => $u['firstname'],
|
||||||
|
'LASTNAME' => $u['lastname'],
|
||||||
|
);
|
||||||
|
foreach($rep AS $k=>$v) {
|
||||||
|
$text=ereg_replace("\[$k\]",$v,$text);
|
||||||
|
}
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
function email_send($val,$to,$sub_subject=array(),$sub_body=array())
|
function email_send($val,$to,$sub_subject=array(),$sub_body=array())
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
@ -886,7 +903,8 @@ function email_send($val,$to,$sub_subject=array(),$sub_body=array())
|
|||||||
{
|
{
|
||||||
$subject=i18n($r->subject);
|
$subject=i18n($r->subject);
|
||||||
$body=i18n($r->body);
|
$body=i18n($r->body);
|
||||||
|
|
||||||
|
/* Eventually we should just do this with communication_replace_vars() */
|
||||||
if(count($sub_subject))
|
if(count($sub_subject))
|
||||||
{
|
{
|
||||||
foreach($sub_subject AS $sub_k=>$sub_v)
|
foreach($sub_subject AS $sub_k=>$sub_v)
|
||||||
|
Loading…
Reference in New Issue
Block a user