All email subject to be left blank

I helped someone to allow leaving the subject line blank in the email message so thought I would add it to the tips forum.

First of all, you can not have a blank subject; it is used to form the URL so that you have something to click on to view the message.  What we will do is to make a few changes so that if the subject line is blank, then the subject will be "No Subject"

In mail.php you need to find the following:


                if(!$sMessageSubject) {
                    $sErrorMessage = '_Mailbox title empty';
                }

Change that to

                if(!$sMessageSubject) {
                    $sMessageSubject = 'No Subject';
                }

Now you need to disable the javascript alert message.  In /inc/js/mail_box.js find:

            var sComposeSubject =  $.trim($('#' + htmlSelectors[1]).attr('value'));
            if(!sComposeSubject) {
                sErrorMessage = _t('_Mailbox title empty');
            }

Delete the part:

            if(!sComposeSubject) {
                sErrorMessage = _t('_Mailbox title empty');
            }

Make backups of your files first.  You may need to clear caches including your browser cache.

Geeks, making the world a better place
Quote · 12 Oct 2013

LOL, I only typed part of allow LOL

Geeks, making the world a better place
Quote · 12 Oct 2013

Thank you for this tip, it is very useful.

I would also like to prevent a message from leaving if it does not contain at least x characters so as to avoid too short messages such as "how are you?"

Do you know how to do that?

Baloo
Quote · 21 Mar 2018
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.