Facebook to email

Facebook to email Git Source Tree

Root/modules/cotesud.php

1<?php
2/**
3 * Copyright 2014 Grégory Soutadé
4 *
5 * This file is part of f2email.
6 *
7 * f2email is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * f2email is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with f2email. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21
22require_once "email.php";
23
24class CoteSud extends Email
25{
26 function getName() { return "CoteSud"; }
27
28 function getDescription() { return "Sends an email for each new notification that was created the current day between 7h am and 11h am"; }
29
30 function manageNotification($fb_object, $notification)
31 {
32 // Invalid after 12h am
33 if (date("H") > 12) return;
34
35 $cur_day = date("d");
36 $d = date_parse($notification["created_time"]);
37
38 // Today between 07h am and 11h am
39 if ($d["hour"] >= 07 && $d["hour"] <= 11 && $d["day"] == $cur_day)
40 parent::manageNotification($fb_object, $notification);
41 }
42}
43?>

Archive Download this file

Branches