Skip to content
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 6 additions and 26 deletions.
  1. +5 −4 templates/emails/send_alert.tpl
  2. +1 −22 tools/alertomatic.php
View
9 templates/emails/send_alert.tpl
@@ -1,8 +1,6 @@
{textformat style='email'}
-{if $leaflet_count == 1}New leaflet has been uploaded{else}New leaflets have been uploaded{/if}:
-
-{$url}
+{if $leaflet_count == 1}New leaflet has been uploaded{else}New leaflets have been uploaded{/if}.
Details:
@@ -11,8 +9,11 @@ Details:
{$leaflet->title}
+{$url}{$leaflet->leaflet_id}
+
+
{/foreach}
Unsubscribe, or change this alert : {$unsub_url}
-{/textformat}
+{/textformat}
View
23 tools/alertomatic.php
@@ -85,7 +85,7 @@ function send_alert($email_alert, $leaflets) {
$smarty->template_dir = TEMPLATE_DIR;
$smarty->assign('leaflets', $leaflets);
$smarty->assign('leaflet_count', $leaflets);
- $smarty->assign('url', get_url($email_alert));
+ $smarty->assign('url', WWW_SERVER . '/leaflets/');
$smarty->assign('unsub_url', WWW_SERVER . '/alerts/manage.php?q=' . $email_alert->confirm_id);
$subject = 'New ' . $email_alert->title;
$body = $smarty->fetch(TEMPLATE_DIR . '/emails/send_alert.tpl');
@@ -97,25 +97,4 @@ function send_alert($email_alert, $leaflets) {
}
}
-function get_url($email_alert) {
- //do we have any matching leaflets?
- if ($email_alert->type == 'attack') {
- $return = WWW_SERVER . '/leaflets.php?a=' . $email_alert->parent_id;
- } else if ($email_alert->type == 'party') {
- $search = factory::create('search');
- $results = $search->search('party', array(array('party_id', '=', $email_alert->parent_id)));
- $return = WWW_SERVER . '/parties/' . $results[0]->url_id;
- } else if ($email_alert->type == 'constituency') {
- $search = factory::create('search');
- $results = $search->search('constituency', array(array('constituency_id', '=', $email_alert->parent_id)));
- $return = WWW_SERVER . '/' . AREA_NAMES . '/' . $results[0]->url_id;
- } else if ($email_alert->type == 'category') {
- $return = WWW_SERVER . '/categories/' . $email_alert->parent_id;
- }
- if (ALERT_DEBUG>0) {
- print "ID=" . $email_alert->parent_id ."\n";
- print $return . "\n\n";
- }
- return $return;
-}
?>

No commit comments for this range

Something went wrong with that request. Please try again.