feat: notif mail field
This commit is contained in:
parent
d0cf59ea4f
commit
c76a64684f
1 changed files with 74 additions and 0 deletions
74
fields/NotifMailField.php
Normal file
74
fields/NotifMailField.php
Normal file
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
|
||||
namespace YesWiki\Custom\Field;
|
||||
|
||||
use YesWiki\Bazar\Field\BazarField;
|
||||
use YesWiki\Core\Service\PageManager;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
/**
|
||||
* @Field({"notifmail"})
|
||||
*/
|
||||
class NotifMailField extends BazarField
|
||||
{
|
||||
public function __construct(array $values, ContainerInterface $services)
|
||||
{
|
||||
parent::__construct($values, $services);
|
||||
$this->size = null;
|
||||
$this->maxChars = null;
|
||||
$this->default = "";
|
||||
}
|
||||
|
||||
protected function renderInput($entry)
|
||||
{
|
||||
return;
|
||||
}
|
||||
public function formatValuesBeforeSave($entry)
|
||||
{
|
||||
if (empty($entry['id_fiche'])) { // que pour la premiere saisie de la fiche
|
||||
$session = '';
|
||||
$session_employeur = false;
|
||||
if (!empty($entry['listefiche2inscription'])) {
|
||||
$session = $entry['listefiche2inscription'];
|
||||
}
|
||||
if (!empty($entry['listefiche9inscription'])) {
|
||||
$session = $entry['listefiche9inscription'];
|
||||
}
|
||||
if (!empty($entry['listefiche8inscription'])) {
|
||||
$session = $entry['listefiche8inscription'];
|
||||
}
|
||||
if (!empty($entry['listefiche10inscription'])) {
|
||||
$session = $entry['listefiche10inscription'];
|
||||
$session_employeur = true;
|
||||
}
|
||||
$s = baz_valeurs_fiche($session);
|
||||
$message = 'Bonjour,
|
||||
|
||||
Nous vous confirmons l’inscription de ' . $entry['bf_prenom'] . ' ' . $entry['bf_nom'] . ' à la session intitulée ' . $s['bf_titre'] . '
|
||||
Cette session fait partie du plan d’accompagnement professionnel 2024 des personnes en convention Adultes-relais en Région Bretagne.
|
||||
|
||||
La personne inscrite ainsi que la structure employeuse recevront la convocation à cette session 14 jours avant la dite session.
|
||||
Si vous n’avez rien reçu 7 jours avant, n’hésitez pas à me contacter.
|
||||
|
||||
Belle journée,
|
||||
Bien à vous,
|
||||
Cyrille Bombard
|
||||
Coordinateur du plan d’accompagnement professionnel 2024 des médiateurs et médiatrices adultes-relais
|
||||
SCOP Wision
|
||||
06 63 28 13 11';
|
||||
$message_html = nl2br($message);
|
||||
include_once 'tools/contact/libs/contact.functions.php';
|
||||
if (!empty($entry['bf_mail'])) {
|
||||
send_mail('noreply@yeswiki.pro', 'Adultes Relais', $entry['bf_mail'], '[Adultes Relais] Confirmation de l\'inscription de ' . $entry['bf_prenom'] . ' ' . $entry['bf_nom'] . ' à ' . $date, $message, $message_html);
|
||||
}
|
||||
if (!empty($entry['bf_contact_administratif_tel_mail'])) {
|
||||
send_mail('noreply@yeswiki.pro', 'Adultes Relais', $entry['bf_contact_administratif_tel_mail'], '[Adultes Relais] Confirmation de l\'inscription de ' . $entry['bf_prenom'] . ' ' . $entry['bf_nom'] . ' à ' . $date, $message, $message_html);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function renderStatic($entry)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue