-
Notifications
You must be signed in to change notification settings - Fork 1
/
Licence.php
46 lines (38 loc) · 1.22 KB
/
Licence.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* This class has been generated by TheliaStudio
* For more information, see https://github.com/thelia-modules/TheliaStudio
*/
namespace Licence;
use Thelia\Module\BaseModule;
use Propel\Runtime\Connection\ConnectionInterface;
use Thelia\Install\Database;
use Thelia\Model\Message;
use Thelia\Model\MessageQuery;
/**
* Class Licence
* @package Licence
*/
class Licence extends BaseModule
{
const MESSAGE_DOMAIN = "licence";
const ROUTER = "router.licence";
public function postActivation(ConnectionInterface $con = null)
{
$database = new Database($con);
$database->insertSql(null, [__DIR__ . "/Config/create.sql", __DIR__ . "/Config/insert.sql"]);
// create new message
if (null === MessageQuery::create()->findOneByName('mail_licence')) {
$message = new Message();
$message
->setName('mail_licence')
->setHtmlTemplateFileName('licence-mail.html')
->setHtmlLayoutFileName('')
->setlocale('fr_FR')
->setSubject('Votre numero de licence')
->setTitle('Email envoie numero de licence')
->setSecured(0)
->save();
}
}
}