On the site page several times the same module is displayed with the feedback form of the form
<form method="post"> <input type="text" name="phoneNumber"> <input type="submit" name="sendNumber" value="Отправить"> </form> When I fill in the phoneNumber field in one form and send the data, the email is duplicated as many times as the module on the page.
In the module folder in the helper.php file helper.php function to send is as follows
public static function sendForm() { if(isset($_POST['sendNumber'])) { $jinput = JFactory::getApplication()->input; $mailer = JFactory::getMailer(); $mailer->addRecipient('myemail@gmail.com'); $phoneNumber = $jinput->get('phoneNumber', '', 'post'); $mailer->setSender('noreply@mydomain.com'); $mailer->setSubject('My subject'); $mailer->setBody($phoneNumber); $mailer->isHTML(true); $mailer->Send(); } } How to make the letter come only once?