Advertisement:

Author Topic: Problem with mails to more than one administrator  (Read 1077 times)

Dublay

  • Newbie
  • *
  • Posts: 33
Problem with mails to more than one administrator
« on: February 24, 2016, 11:25:04 am »
Hi there,

we've seven administrators, but obiously only the first one added to the system gets the "A new item has been posted"-emails. Is it possible to send emails like this to all admins? Actually we haven't setup anything in settings->mailserver (all fields empty), so I guess we're using php mail or something osclass has build-in. Maybe only a custom smtp-server can handle more than one admin-account?

Thanks for your answers!

teseo

  • Hero Member
  • *****
  • Posts: 6169

Dublay

  • Newbie
  • *
  • Posts: 33
Re: Problem with mails to more than one administrator
« Reply #2 on: February 24, 2016, 01:18:37 pm »
Code: [Select]
function cust_send_mail_all_admins($mail, $params) {

    // Multiple admins/moderators?
    if ($params['to'] == osc_contact_email()) {
        $admins = Admin::newInstance()->listAll();

        foreach($admins as $admin) {
            if ($admin['s_email'] != osc_contact_email()) $mail->AddBCC($admin['s_email']);
        }
    }

    return $mail;
}

osc_add_filter('init_send_mail', 'cust_send_mail_all_admins');

Thanks for your answer - using this, no email has been sent at all. Any ideas?

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Problem with mails to more than one administrator
« Reply #3 on: February 24, 2016, 02:28:40 pm »
Just re-checked this procedure and it's still working fine for me. ??? Did you thoroughly follow the instructions to add this function to your theme functions.php?

Note: Gmail addresses might be giving problems with this, ??? test it with other mail providers for secondary administrators/moderators.

Regards
« Last Edit: February 24, 2016, 02:32:02 pm by teseo »

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Problem with mails to more than one administrator
« Reply #4 on: February 26, 2016, 04:27:19 am »
The problem is more "serious" than this, Osclass has some mixup with email accounts that should and should not be used.

I fixed this here https://github.com/osclass/Osclass/pull/1980/files, but it needs to reviewed by the team, maybe they have some better ideas etc. With this, gmail should normally not be a problem, since those are automated service messages.

Regards

bazinga

  • Full Member
  • ***
  • Posts: 125
Re: Problem with mails to more than one administrator
« Reply #5 on: July 13, 2016, 11:41:22 pm »
someone can help me with this problem... sending emails just stop working, after I update Osclass 3.5.9.

http://forums.osclass.org/desarrollo/ayuda-expertos-hay-algo-mal-en-osclass-ver-3-5-9-los-emails-no-se-envian/msg141803/#msg141803