How to disable email?

  • Arbind Bhagat
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
2 months 4 weeks ago #164113 by Arbind Bhagat
How to disable email? was created by Arbind Bhagat
How to disable email going out to registrant when adding them manually on backend?

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

  • Tuan Pham Ngoc
  • Online
  • Administrator
  • Administrator
More
2 months 4 weeks ago #164114 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to disable email?
Hello

There is no option to disable that email. If you disable it, then email won't be sent to registrants registered from frontend of your site as well

Regards,

Tuan

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

  • Tuan Pham Ngoc
  • Online
  • Administrator
  • Administrator
More
2 months 4 weeks ago #164115 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to disable email?
You can try to edit the code on this file administrator/components/com_eventbooking/model/common/registrant.php , remove the block of code from 288 to 295:
Code:
if ((int) $row->published === 3) { EventbookingHelper::callOverridableHelperMethod('Mail', 'sendWaitinglistEmail', [$row, $config]); } else { EventbookingHelper::callOverridableHelperMethod('Mail', 'sendEmails', [$row, $config]); }

Regards,

Tuan

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

  • Arbind Bhagat
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
2 months 4 weeks ago #164116 by Arbind Bhagat
Replied by Arbind Bhagat on topic How to disable email?
I did it this way:

In the /components/com_eventbooking/helper/mail.php file, I replaced code-block-1 with code-block-2. This way, it will work as usual for all other users but won't send email when I am logged in as "myusername" user. This is useful when I want to migrate registrants from other system to Event Booking.

code-block-1:
// Send to billing member, get attachments back and use it to add to attachments to group member email
$attachments = EventbookingHelper::callOverridableHelperMethod(
'Mail',
'sendRegistrationEmailToRegistrant',
[$mailer, $row, $rowMembers, $replaces, $rowFields, $invoiceFilePath]
);


code-block-2:
$user = Joomla\CMS\Factory::getUser();
$username = $user->get('username');
if($username != "myusername"){
// Send to billing member, get attachments back and use it to add to attachments to group member email
$attachments = EventbookingHelper::callOverridableHelperMethod(
'Mail',
'sendRegistrationEmailToRegistrant',
[$mailer, $row, $rowMembers, $replaces, $rowFields, $invoiceFilePath]
);
}

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

  • Tuan Pham Ngoc
  • Online
  • Administrator
  • Administrator
More
2 months 4 weeks ago #164117 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to disable email?
That works, too. But please implement the change using override so that it won't be lost when you update to future releases of the extension. See eventbookingdoc.joomservices.com/develop...thods-helper-methods

Regards,

Tuan

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

  • Arbind Bhagat
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
2 months 4 weeks ago #164118 by Arbind Bhagat
Replied by Arbind Bhagat on topic How to disable email?
Thank you Tuan. Your recommendations are always so helpful.

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

  • Tuan Pham Ngoc
  • Online
  • Administrator
  • Administrator
More
2 months 4 weeks ago #164119 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to disable email?
You're welcome. Have a nice weekend

Regards,

Tuan

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

Moderators: Tuan Pham Ngoc