Reply-to field with empty string get saved in DB as NULL
Issue:
Somehow our client's mailing got saved with 'NULL' reply-to field and was causing problems. On looking into it and trying to reproduce the issue, 'reply to' field can be NULL in the following case
- Add a new mailing (or reuse one)
- Select a 'reply to' email (I had to enable "Enable Custom Reply-To" in 'civicrm/admin/mail')
- Fill in other fields as usual
- Under 'Responses' tab, check "Track Replies" checkbox. This brings up a warning message on the top right saying 'reply-to' has been cleared out (but still allows user to save mailing)
- Proceed to next step and save mailing
Proposed Fix:
I am not sure how to fix this as the user is expected to see the warning message and act accordingly. But I think we can check and not allow NULL values for reply-to in DB. In CRM_Mailing_BAO_Mailing.php when adding a new mailing (add() method), there is a condition to check if 'reply-to' field is set and if it is not set, then 'from-email' is used. here instead if using if(!isset($params['replyto_email']))... we should use if(empty($params['replyto_email']))... so that empty string like '' will also be considered and reply-to could not be NULL