I have added hereunder (in itemform override) to be notified when front-end users add new item. Great I am able to have the item title in the mail !
However I will receive 2 emails each time a front-end user edit / add items
.
So 1 email when itemform is loaded and 1 when it is saved.
I was hoping that I could get the exact place where to put the code so that each time the save button is triggered, it's only then that the email is sent.
I guess it should be somewhere here :
However I will receive 2 emails each time a front-end user edit / add items
So 1 email when itemform is loaded and 1 when it is saved.
I was hoping that I could get the exact place where to put the code so that each time the save button is triggered, it's only then that the email is sent.
<!-- send email to admin-->
<?php
$to = "[email protected]";
$subject = "New Item / Item edited on Website";
$txt = $this->row->title;
$headers = "From: [email protected]";
mail($to,$subject,$txt,$headers);
?>I guess it should be somewhere here :
<?php if($app->isSite()): ?>
<!-- Frontend Item Editing (Modal View) -->
<div id="k2ModalContainer" class="toppad1">
<div id="k2ModalHeader">
<h2 id="k2ModalLogo"><span><?php echo (JRequest::getInt('cid')) ? JText::_('K2_EDIT_ITEM') : JText::_('K2_ADD_ITEM'); ?></span></h2>
<table id="k2ModalToolbar" cellpadding="2" cellspacing="4">
<tr>
<td id="toolbar-save" class="button">
<a href="#" onclick="Joomla.submitbutton('save');return false;">
<i class="fa fa-check" aria-hidden="true"></i> <?php echo JText::_('K2_SAVE'); ?>
</a>
</td>
<td id="toolbar-cancel" class="button">
<a href="#">
<i class="fa fa-times-circle" aria-hidden="true"></i> <?php echo JText::_('K2_CLOSE'); ?>
</a>
</td>
</tr>
</table>
</div>
<?php endif; ?>Edited 5 years 6 months ago by Goble002