Group's broadcasts don't reply to sender ?

Hello all,

I just discovered, that the sender of a broadcast mail to all group fans (same in events) is always the main dolphin address (s.th. like info@community.com)

But instead it should be the author of that group or event in order receive replies to those broadcast mails properly. Right now answers to those mails go to the community-admin or someone else who has nothing to do with that.

Does anyone know a small fix for that (maybe a little change in modules or broadcast code) ?

Thanks a lot, Tom

Quote · 9 Oct 2013

Because of my impatience I did some tests last evening and develeped a small mod that sets the correct sender to those broadcast mails.

The result ist this tiny little mod for Dolphin 7.1.4 (maybe it works as well in other versions).

 

1. Change function sendMail() in inc/utils.inc.php

old code (function declaration at line 425):
function sendMail( $sRecipientEmail, $sMailSubject, $sMailBody, $iRecipientID = 0, $aPlus = array(), $sEmailFlag = 'html', $isDisableAlert = false, $bForceSend = false )

new code:
function sendMail( $sRecipientEmail, $sMailSubject, $sMailBody, $iRecipientID = 0, $aPlus = array(), $sEmailFlag = 'html', $isDisableAlert = false, $bForceSend = false, $sendfrom = "", $sendtitle = "")

 

old code (in function at line 442):
    $sEmailNotify       = isset($GLOBALS['site']['email_notify']) ? $GLOBALS['site']['email_notify'] : getParam('site_email_notify');
    $sSiteTitle         = isset($GLOBALS['site']['title']) ? $GLOBALS['site']['title'] : getParam('site_title');   
    $sMailHeader        = "From: =?UTF-8?B?" . base64_encode( $sSiteTitle ) . "?= <{$sEmailNotify}>";
    $sMailParameters    = "-f{$sEmailNotify}";
new code that extends the sender's title:
    $sEmailNotify       = isset($GLOBALS['site']['email_notify']) ? $GLOBALS['site']['email_notify'] : getParam('site_email_notify');
    $sSiteTitle         = isset($GLOBALS['site']['title']) ? $GLOBALS['site']['title'] : getParam('site_title');
    if ($sendfrom != "") {
        $sEmailNotify = $sendfrom;
        $sSiteTitle .= $sendtitle;
    }
    $sMailHeader        = "From: =?UTF-8?B?" . base64_encode( $sSiteTitle ) . "?= <{$sEmailNotify}>";
    $sMailParameters    = "-f{$sEmailNotify}";

alternative code that replaces the sender's title:
    $sEmailNotify       = isset($GLOBALS['site']['email_notify']) ? $GLOBALS['site']['email_notify'] : getParam('site_email_notify');
    $sSiteTitle         = isset($GLOBALS['site']['title']) ? $GLOBALS['site']['title'] : getParam('site_title');
    if ($sendfrom != "") $sEmailNotify = $sendfrom;
    if ($sendtitle != "") $sSiteTitle = $sendtitle;
    $sMailHeader        = "From: =?UTF-8?B?" . base64_encode( $sSiteTitle ) . "?= <{$sEmailNotify}>";
    $sMailParameters    = "-f{$sEmailNotify}";

that leaves the function as it is, only when additional parameters are given, they replace the default sender and optionally change the sender's title.

 

2. Change in inc/classes/BxDolTwigModule.php about line 320

old code:
foreach ($aRecipients as $aProfile) {
                   $iSentMailsCounter += sendMail($aProfile['Email'], $aTemplate['Subject'], $aTemplate['Body'], $aProfile['ID'], $aTemplateVars);
            }

new code (simply extended with the group/event author's e-mail):
$aAuthor = getProfileInfo($aDataEntry[$this->_oDb->_sFieldAuthorId]);
foreach ($aRecipients as $aProfile) {
                   $iSentMailsCounter += sendMail($aProfile['Email'], $aTemplate['Subject'], $aTemplate['Body'], $aProfile['ID'], $aTemplateVars,'html',false,false,$aAuthor['Email']);
            }

alternatively, if you like to modify the sender's title as well this can be done like this by adding an additional parameter to function sendMail()
I created a new system language-key "_Broadcast" in the backend-language-editor for that to use it below as you can see. The sender's title in my mod only extends the default sender title text. To have it replaced completely you have to change function sendMail() a little (see above).

$aAuthor = getProfileInfo($aDataEntry[$this->_oDb->_sFieldAuthorId]);
foreach ($aRecipients as $aProfile) {
                  $iSentMailsCounter += sendMail($aProfile['Email'], $aTemplate['Subject'], $aTemplate['Body'], $aProfile['ID'], $aTemplateVars,'html',false,false,$aAuthor['Email'],' - '._t('_Broadcast').'
'._t('_from').' '.$aAuthor['NickName']);

}

Hope this helps anyone and maybe it will find it's way to further Dolphin versions by default.

ATTENTION!
Be aware that with every regular update of Dolphin this mod may be overwritten so have an eye on the code and control this after every update of Dolphin.

Tom

Quote · 10 Oct 2013
 
 
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.