<dt>{lang}wcf.acp.devtools.notificationTest.instantEmail{/lang}</dt>
<dd><pre>{$event[instantEmail]}</pre></dd>
</dl>
- {else}
+ {elseif $event[instantEmailException]|isset}
<dl>
<dt>{lang}wcf.acp.devtools.notificationTest.instantEmail.exception{/lang}</dt>
<dd><pre>{$event[instantEmailException]}</pre></dd>
<dl>
{foreach from=$events item=event}
- <dt>{$event[description]}</dt>
- <dd><pre>{if $event[instantEmail]|isset}{$event[instantEmail]}{else}{$event[instantEmailException]}{/if}</pre></dd>
+ {if $event[instantEmail]|isset || $event[instantEmailException]|isset}
+ <dt>{$event[description]}</dt>
+ <dd><pre>{if $event[instantEmail]|isset}{$event[instantEmail]}{else}{$event[instantEmailException]}{/if}</pre></dd>
+ {/if}
{/foreach}
</dl>
</section>
$errors++;
}
- try {
- $eventData['instantEmail'] = TestableUserNotificationEventHandler::getInstance()->getEmailBody($event, 'instant');
- }
- catch (\Exception $e) {
- $eventData['instantEmailException'] = $getRenderedException($e);
- $errors++;
- }
- catch (\Throwable $e) {
- $eventData['instantEmailException'] = $getRenderedException($e);
- $errors++;
+ // for instant emails, a notification can only be triggered once
+ if ($event->getNotification()->timesTriggered == 1) {
+ try {
+ $eventData['instantEmail'] = TestableUserNotificationEventHandler::getInstance()->getEmailBody($event, 'instant');
+ }
+ catch (\Exception $e) {
+ $eventData['instantEmailException'] = $getRenderedException($e);
+ $errors++;
+ }
+ catch (\Throwable $e) {
+ $eventData['instantEmailException'] = $getRenderedException($e);
+ $errors++;
+ }
}
}