Keyword

K2 front-end items added > notifications

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
2 weeks 6 days ago - 2 weeks 6 days ago #178732 by Goble002
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.

<!-- 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; ?>
Last edit: 2 weeks 6 days ago by Goble002.

Please Log in or Create an account to join the conversation.

More
2 weeks 6 days ago #178733 by Loai Ahmed
Replied by Loai Ahmed on topic K2 front-end items added > notifications
Hi, I am unable to post a direct link for this extension but you can search for an extension named "Content Notifications" by minitek
it sends notifications on items created and updated.
you may find it useful.
Regards.

Please Log in or Create an account to join the conversation.

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
2 weeks 6 days ago #178735 by Goble002
Replied by Goble002 on topic K2 front-end items added > notifications
Thanks,

I have tested with Articles (since for k2 items you need to purchase the pro version). The issue is that I will have (as admin) to manually subscribe to each and every items. And I have a lot of items and there are a lot coming.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum