Skip to content

Commit

Permalink
Merge pull request #488 from humhub/enh/284-update-email-content
Browse files Browse the repository at this point in the history
Update email content
  • Loading branch information
luke- authored Jun 25, 2024
2 parents d1ffdc1 + 36acf6c commit b8eabec
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 24 deletions.
24 changes: 11 additions & 13 deletions widgets/mails/views/eventInfoHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,28 @@
<?php endif; ?>

<?php if (!empty($event->getStartDateTime())): ?>
<?= Yii::t('CalendarModule.mail', '<strong>Starting</strong> {date}', [
'date' => $formatter->getFormattedTime()
]) ?>
<br>
<strong><?= Yii::t('CalendarModule.mail', 'Starting') ?>:</strong>
<?= $formatter->getFormattedTime() ?><br><br>
<?php endif; ?>

<?php if ($event instanceof CalendarEventParticipationIF): ?>
<?php if ($event->getOrganizer()) : ?>
<b><?= Yii::t('CalendarModule.mail', 'Organized by {userName}', ['userName' => Html::encode($event->getOrganizer()->displayName)]) ?></b>
<?php endif; ?>
<?php if ($event instanceof CalendarEventParticipationIF && $event->getOrganizer()): ?>
<strong><?= Yii::t('CalendarModule.mail', 'Organizer') ?>:</strong>
<?= Html::encode($event->getOrganizer()->displayName) ?><br><br>
<?php endif; ?>

<?php if (!empty($event->getLocation())): ?>
<b><?= Yii::t('CalendarModule.mail', 'Location:') ?> <?= Html::encode($event->getLocation()) ?></b>
<br>
<strong><?= Yii::t('CalendarModule.mail', 'Location') ?>:</strong>
<?= Html::encode($event->getLocation()) ?><br><br>
<?php endif; ?>

<?php if (!empty($event->getDescription())): ?>
<p><?= RichTextToEmailHtmlConverter::process($event->getDescription()) ?></p>
<strong><?= Yii::t('CalendarModule.mail', 'Description') ?>:</strong><br>
<?= RichTextToEmailHtmlConverter::process($event->getDescription()) ?><br>
<?php endif; ?>

<?php if (isset($extraInfo) && !empty($extraInfo)): ?>
<h2><?= Yii::t('CalendarModule.mail', 'Additional information:'); ?></h2>
<p><?= RichTextToEmailHtmlConverter::process($extraInfo) ?></p>
<strong><?= Yii::t('CalendarModule.mail', 'Participants info') ?>:</strong><br>
<?= RichTextToEmailHtmlConverter::process($extraInfo) ?><br>
<?php endif; ?>
</td>
</tr>
Expand Down
17 changes: 6 additions & 11 deletions widgets/mails/views/eventInfoText.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
use humhub\modules\calendar\interfaces\participation\CalendarEventParticipationIF;
use humhub\modules\calendar\models\CalendarDateFormatter;
use humhub\modules\content\widgets\richtext\RichText;
use humhub\widgets\mails\MailButton;
use humhub\widgets\mails\MailButtonList;

/* @var $event CalendarEventIF */
/* @var $url string */
Expand All @@ -26,27 +24,24 @@
<?= $event->getTitle() ?>

<?php if (!empty($event->getStartDateTime())): ?>
<?= strip_tags(Yii::t('CalendarModule.mail', '<strong>Starting</strong> {date}', [
'date' => $formatter->getFormattedTime()
])) ?>
<?= Yii::t('CalendarModule.mail', 'Starting') ?>: <?= $formatter->getFormattedTime() ?>
<?php endif; ?>

<?php if ($event instanceof CalendarEventParticipationIF): ?>
<?php if ($event->getOrganizer()): ?>
<?= Yii::t('CalendarModule.mail', 'Organized by {userName}', ['userName' => Html::encode($event->getOrganizer()->displayName)]) ?>
<?php endif; ?>
<?php if ($event instanceof CalendarEventParticipationIF && $event->getOrganizer()): ?>
<?= Yii::t('CalendarModule.mail', 'Organizer') ?>: <?= Html::encode($event->getOrganizer()->displayName) ?>
<?php endif; ?>

<?php if (!empty($event->getLocation())): ?>
<?= Yii::t('CalendarModule.mail', 'Location:') ?> <?= Html::encode($event->getLocation()) ?>
<?= Yii::t('CalendarModule.mail', 'Location') ?>: <?= Html::encode($event->getLocation()) ?>
<?php endif; ?>

<?php if (!empty($event->getDescription())): ?>
<?= Yii::t('CalendarModule.mail', 'Description') ?>:
<?= RichText::preview($event->getDescription()) ?>
<?php endif; ?>

<?php if (isset($extraInfo) && !empty($extraInfo)): ?>
<?= Yii::t('CalendarModule.mail', 'Additional information:'); ?>
<?= Yii::t('CalendarModule.mail', 'Participants info') ?>:
<?= RichText::preview($extraInfo) ?>
<?php endif; ?>

Expand Down

0 comments on commit b8eabec

Please sign in to comment.