Extension Overrides disabled "Send Confirmation and Receipt" when offline registering participant
Previously opened on [Civicore](https://lab.civicrm.org/dev/core/-/issues/4050)
Overview
----------------------------------------
When performing an offline Event Registration, you cannot disable "Send Confirmation and Receipt". The POST handler ```civicrm/contact/view/participant``` sends out emails irrespective of the disabled checkbox on the UI and the disabled default event page configuration.
https://chat.civicrm.org/civicrm/pl/4uy3mp5c3jbtjdx96fif6nk4ie
_If you have already posted on https://civicrm.stackexchange.com or https://chat.civicrm.org, please include the link to that conversation._
Reproduction steps
----------------------------------------
1. Open a Contact
1. Click on **Actions-> Register for Event**.
1. After any Event, Disable **☑️ Send Confirmation and Receipt** and **Save**.
1. Got a success of **"Event registration for Test Email has been added. A confirmation email has been sent to"**.
(No email should have been sent)
Current behaviour
----------------------------------------
_What happens currently. Please provide error messages, screenshots or gifs ([LICEcap](http://www.cockos.com/licecap/), [SilentCast](https://github.com/colinkeenan/silentcast)) where appropriate._
Currently Sends this payload with a disabled send notification and disabled Payment box
```
entryURL:
https://example.website/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontact%2Fview%2Fparticipant&page=CiviCRM&reset=1&action=add&cid=497&context=participant
_qf_default:
Participant:upload
MAX_FILE_SIZE: 83886080
_qf_Participant_upload: 1
contact_id: 497
event_id: 15
campaign_id: 8
role_id[]: 1
register_date: 2022-12-27 13:23:00
status_id: 1
source:
hidden_feeblock: 1
hidden_eventFullMsg:
priceSetId: 10
price_16:
price_13:
price_11:
financial_type_id: 4
total_amount: 0
receive_date: 2022-12-27 13:23:00
trxn_id:
contribution_status_id: 1
payment_instrument_id: 4
check_number:
from_email_address: 185
receipt_text:
note:
hidden_custom: 1
hidden_custom_group_count[]: 1
custom_21_-1:
custom_18_-1: 0
custom_19_-1: 0
custom_20_-1: 0
custom_22_-1:
hidden_custom: 1
hidden_custom_group_count[]: 1
hidden_custom: 1
hidden_custom_group_count[]: 1
hidden_custom: 1
hidden_custom_group_count[]: 1
```
I injected a null value into the options to select from the drop down which changed the parameter of ```from_email_address: 185``` to ```from_email_address: ``` Unfortunately, that is not how the post handler determines if to send a message because i got this error:
 So it still tried to send with the unset email address.
Expected behaviour
----------------------------------------
_What should happen._
No email is sent.
Environment information
----------------------------------------
<!-- Some of the items below may not be relevant for every bug - if in doubt please include more information than you think is neccessary. -->
* __Browser:__ _Edge 108.0.1462.54_
* __CiviCRM:__ _5.56.0, 5.55.3_
* __PHP:__ _7.4?_
* __CMS:__ _Wordpress 6.1.1_
* __Database:__ _Maria DB_
* __Web Server:__ _Apache 2_
* __Extension:__ _CiviMobileAPI 6.1.1_
Comments
----------------------------------------
I'm not skilled in reading how php handles calls and everything, so i can't find the handler that this post query relates to. Any pointers would help!
issue