dolibarr 18.0.6
mailing.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
3 * Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
25// Load Dolibarr environment
26require '../../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
28require_once DOL_DOCUMENT_ROOT.'/datapolicy/class/datapolicy.class.php';
29
30$idcontact = GETPOST('idc', 'int');
31$idcompany = GETPOST('ids', 'int');
32$idmember = GETPOST('ida', 'int');
33
34// Security
35if (!isModEnabled("datapolicy")) {
37}
38if (!$user->admin) {
40}
41
42
43/*
44 * Actions
45 */
46
47if (!empty($idcontact)) {
48 $contact = new Contact($db);
49 $contact->fetch($idcontact);
51} elseif (!empty($idcompany)) {
52 $company = new Societe($db);
53 $company->fetch($idcompany);
55} elseif (!empty($idmember)) {
56 $member = new Adherent($db);
57 $member->fetch($idmember);
59} else {
60 $contacts = new DataPolicy($db);
61
62 // Send email to all contacts where email was not already sent
63 $contacts->getAllContactNotInformed();
64 $contacts->getAllCompaniesNotInformed();
65 $contacts->getAllAdherentsNotInformed();
66}
67
68
69/*
70 * View
71 */
72
73echo $langs->trans('AllAgreementSend');
Class to manage members of a foundation.
Class to manage contact/addresses.
Class DataPolicy.
static sendMailDataPolicyAdherent($adherent)
sendMailDataPolicyAdherent
static sendMailDataPolicyContact($contact)
sendMailDataPolicyContact
static sendMailDataPolicyCompany($societe)
sendMailDataPolicyCompany
Class to manage third parties objects (customers, suppliers, prospects...)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.