From c4e387d440ef6690026e6fc4f072fb47eef89879 Mon Sep 17 00:00:00 2001 From: randomdan Date: Wed, 1 Sep 2010 23:10:29 +0000 Subject: email users when new ebuilds come along that they have tracked --- gentoobrowse/console/emailebuilds.xml | 42 +++++++++++++++++++++++++++++ gentoobrowse/emails/newpackageversions.xml | 27 +++++++++++++++++++ gentoobrowse/emails/newpackageversions.xslt | 25 +++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 gentoobrowse/console/emailebuilds.xml create mode 100644 gentoobrowse/emails/newpackageversions.xml create mode 100644 gentoobrowse/emails/newpackageversions.xslt diff --git a/gentoobrowse/console/emailebuilds.xml b/gentoobrowse/console/emailebuilds.xml new file mode 100644 index 0000000..14f57f6 --- /dev/null +++ b/gentoobrowse/console/emailebuilds.xml @@ -0,0 +1,42 @@ + + + + + + select ut.userid, ut.useremail from + (select e.ebuildid, u.userid, u.useremail + from files f, ebuilds e, user_packages up, users u + where e.packageid = up.packageid + and f.fileid = e.ebuildid + and u.userid = up.userid + and f.firstseen > up.trackedsince) as ut left outer join user_ebuild_emails ebe + on ebe.userid = ut.userid and ebe.ebuildid = ut.ebuildid + where ebe.userid is null + group by ut.userid, ut.useremail + + + + + insert into user_ebuild_emails(ebuildid, userid, sentat) + select ut.ebuildid, ut.userid, now() + from ( + select e.ebuildid, up.userid + from files f, ebuilds e, user_packages up, users u + where e.packageid = up.packageid + and f.fileid = e.ebuildid + and u.userid = up.userid + and u.userid = ? + and f.firstseen > up.trackedsince) as ut left outer join user_ebuild_emails ebe + on ebe.userid = ut.userid and ebe.ebuildid = ut.ebuildid + where ebe.userid is null + + + + + + + + + diff --git a/gentoobrowse/emails/newpackageversions.xml b/gentoobrowse/emails/newpackageversions.xml new file mode 100644 index 0000000..83bebbc --- /dev/null +++ b/gentoobrowse/emails/newpackageversions.xml @@ -0,0 +1,27 @@ + + + + + + select ut.cname, ut.pname, ut.version + from ( + select e.ebuildid, up.userid, u.useremail, p.name as pname, c.name as cname, e.version + from files f, ebuilds e, user_packages up, users u, packages p, categories c + where e.packageid = up.packageid + and f.fileid = e.ebuildid + and u.userid = up.userid + and u.userid = ? + and e.packageid = p.packageid + and c.categoryid = p.categoryid + and f.firstseen > up.trackedsince) as ut left outer join user_ebuild_emails ebe + on ebe.userid = ut.userid and ebe.ebuildid = ut.ebuildid + where ebe.userid is null + order by ut.cname, ut.pname, ut.version + + + + + + + diff --git a/gentoobrowse/emails/newpackageversions.xslt b/gentoobrowse/emails/newpackageversions.xslt new file mode 100644 index 0000000..abdd9e4 --- /dev/null +++ b/gentoobrowse/emails/newpackageversions.xslt @@ -0,0 +1,25 @@ + + + + + + + Welcome to Gentoo Browse + + +

All new shiny ebuilds available!

+
    + +
  • + /- +
  • +
    +
+ + +
+
+ -- cgit v1.2.3