Lettersail: online English school for kids on MODX 3 (templates, chunks, snippets, plugins, scripts)

This commit is contained in:
jimagie committed 2026-11-01 18:30:36 +05:00
commit 3799cf8de5
96 files changed
+4423

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
<?php
$to = trim((string) $modx->getOption('ls_lead_to'));
if ($to === '') {
return true;
}
$body = $modx->getChunk('ls.lead.mail', $hook->getValues());
$modx->getService('mail', 'mail.modPHPMailer');
$modx->mail->set(MODX\Revolution\Mail\modMail::MAIL_BODY, $body);
$modx->mail->set(MODX\Revolution\Mail\modMail::MAIL_FROM, (string) $modx->getOption('emailsender', null, $to));
$modx->mail->set(MODX\Revolution\Mail\modMail::MAIL_FROM_NAME, 'Lettersail');
$modx->mail->set(MODX\Revolution\Mail\modMail::MAIL_SENDER, (string) $modx->getOption('emailsender', null, $to));
$modx->mail->set(MODX\Revolution\Mail\modMail::MAIL_SUBJECT, 'Заявка на пробный урок');
$modx->mail->address('to', $to);
$modx->mail->setHTML(true);
if (!$modx->mail->send()) {
$modx->log(MODX\Revolution\modX::LOG_LEVEL_ERROR, 'lsLeadMail: письмо не отправлено: ' . $modx->mail->mailer->ErrorInfo);
}
$modx->mail->reset();
return true;