ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: NetFlag on December 13, 2013, 01:40:10 am

Title: Send out Newsletter failed
Post by: NetFlag on December 13, 2013, 01:40:10 am
Good morning!
Generally ElkArte send E-Mails. All went well!
But...the attempt send out newsletter (admin;area=news;sa=mailingsend) failed. Return in a blank page.
At the moment no access to server, therefor not in greater detail. Sorry. 

Regards
NetFlag
Title: Re: Send out Newsletter failed
Post by: emanuele on December 13, 2013, 03:09:31 am
Thanks NetFlag!

It's a missing require.

In sources/admin/ManageNews.controller.php:
Code: (find) [Select]
			// Get the smelly people - note we respect the id_member range as it gives us a quicker query.
Code: (add) [Select]
			require_once(SUBSDIR . '/News.subs.php');

ETA Fixed locally, will push "soon". ;)
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 13, 2013, 03:55:17 am
And again, codefix in a great pace. You knows ElkArtes stuff. Neat!
Title: Re: Send out Newsletter failed
Post by: emanuele on December 13, 2013, 05:03:11 am
But there is still a bug there... lol
https://github.com/emanuele45/Dialogo/commit/255a2a18cb2e51bce9070828158bedef065cfba6

And while I was there, I added also an intermediate page when the news letter is finished to inform of the successful sending:
https://github.com/emanuele45/Dialogo/commit/f74a51143cd617c2e5e9ae727aa396d225b05d0f

technically I think there is a sort of bug that there is no indication that the newsletter was sent to 0 members (in case nobody fits into the conditions), it should be fixed as well.
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 13, 2013, 12:54:18 pm
I can do what I want, loading bar stops at 8,33%. Only the administrator (uid1) receives the mail.    :( 
Title: Re: Send out Newsletter failed
Post by: emanuele on December 13, 2013, 01:31:04 pm
Ohhh.. right there were more things:
https://github.com/emanuele45/Dialogo/commit/e00baaab921e71f3b397bf208337d388c63d6fd1
https://github.com/emanuele45/Dialogo/commit/3c21ebf92309ccdf65ae087d96357589786bdf85
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 13, 2013, 02:01:07 pm
Now Im confused. This is my sources/Subs.php Line 3125 till 3169.
Code: [Select]
	// Output the declared Javascript variables.
if (!empty($context['javascript_vars']) && !$do_defered)
{
echo '
<script><!-- // --><![CDATA[';

$output = array();
foreach ($context['javascript_vars'] as $key => $value)
$output[] = $key . ' = ' . $value;

echo '
var ' . implode(",\n\t\t\t", $output) . ';';

echo '
// ]]></script>';
}

// Inline JavaScript - Actually useful some times!
if (!empty($context['javascript_inline']))
{
if (!empty($context['javascript_inline']['defer']) && $do_defered)
{
echo '
<script><!-- // --><![CDATA[';

foreach ($context['javascript_inline']['defer'] as $js_code)
echo $js_code;

echo '
// ]]></script>';
}

if (!empty($context['javascript_inline']['standard']) && !$do_defered)
{
echo '
<script><!-- // --><![CDATA[';

foreach ($context['javascript_inline']['standard'] as $js_code)
echo $js_code;

echo '
// ]]></script>';
}
}
}

No match to yours here on Github. (https://github.com/emanuele45/Dialogo/commit/3c21ebf92309ccdf65ae087d96357589786bdf85)
Title: Re: Send out Newsletter failed
Post by: emanuele on December 13, 2013, 02:06:21 pm
Then probably you are using a version of few days ago and the code is still the old one, then the other one should be enough. ;)
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 13, 2013, 02:31:49 pm
Ah, I was not yet clear about the package get updates. So its me to upgrade my installation.
Have to test a little bit more on weekend.
Thank you Emanuele!
Title: Re: Send out Newsletter failed
Post by: emanuele on December 13, 2013, 03:07:37 pm
Starting from the beta up to now, we didn't change anything on the database, so it is enough to just grab the package and replace the files in order to be up-to-date! :)
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 14, 2013, 08:07:26 am
Now everything is on the current state here. Test send out newsletter. Elk says all went well:
QuoteYou have successfully sent your newsletter!

It is not. Actually still only members of the group Administrator get mails.

Edit:
New evidence. Delivery only fails if user still has no primary membergroup.
Title: Re: Send out Newsletter failed
Post by: emanuele on December 14, 2013, 06:47:29 pm
/me marks this topic unread...
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 16, 2013, 05:45:30 am
...also failed is user in additional group.   :'(
Title: Re: Send out Newsletter failed
Post by: emanuele on December 16, 2013, 06:01:22 am
Try this, in admin/ManageNews.controller.php:
		// Some functions we will need
require_once(SUBSDIR . '/Mail.subs.php');
Use the comment too because there are two instances of the require_once and only the one with the comment is the important one in that case.
And just after it add:
Code: [Select]
		require_once(SUBSDIR . '/News.subs.php');
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 16, 2013, 06:26:37 am
Unfortunately not. All groups, expect my new "Newsletter" (2 Members inside) , uncheckt. Nevertheless no one recieved email. That's Greek to me.
Title: Re: Send out Newsletter failed
Post by: emanuele on December 16, 2013, 07:17:42 am
Try the one attached.
Replace the one in sources/admin/

ETA: also, secondary groups are not considered at all... should they?

ETA2: attachment removed
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 16, 2013, 01:11:04 pm
Quote from: emanuele – Try the one attached.
Replace the one in sources/admin/
Sourcefile can not be read. Tried 5 times. 5 minutes later i get it.

Quote from: emanuele – ETA: also, secondary groups are not considered at all... should they?
Brood...for my logical understanding, yes. Otherwise for me it is very irritating.

Edit:
Unfortunately, the attached file does not work. Same as before.
Title: Re: Send out Newsletter failed
Post by: emanuele on December 16, 2013, 01:22:43 pm
Can you check the error log to see if there is anything there that could be related?
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 16, 2013, 01:47:54 pm
Nothing in there. Strange....

Can someone else reproduce this?
Title: Re: Send out Newsletter failed
Post by: emanuele on December 16, 2013, 02:53:31 pm
Quote from: NetFlag –
Quote from: emanuele –
Quote from: emanuele – ETA: also, secondary groups are not considered at all... should they?
Brood...for my logical understanding, yes. Otherwise for me it is very irritating.
Never mind, I was looking at the wrong line... sorry.
Additional groups are included.

Can you try for debugging the one attached?
When the process is finished it will show you a message with a code block, can you copy and paste the content of the block here?
Title: Re: Send out Newsletter failed
Post by: Spuds on December 16, 2013, 08:31:22 pm
QuoteSourcefile can not be read. Tried 5 times. 5 minutes later i get it.

Sorry for all the downloads on that file, that was me testing to find out why it was doing that ... Figured it out  :)
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 17, 2013, 12:30:37 pm
Quote from: emanuele – Can you try for debugging the one attached?
When the process is finished it will show you a message with a code block, can you copy and paste the content of the block here?
Members to include see attachment. (3 Members)

This is the result:
Code: [Select]
members_collected: 1
members_sent: 1

completed


Title: Re: Send out Newsletter failed
Post by: emanuele on December 17, 2013, 03:45:13 pm
Found it!!
It was a bug introduced last summer in SMF [1], these two changes should fix it:
https://github.com/emanuele45/Dialogo/commit/304e22dd368c6386428c1b65583a4da593a32215

now the ethical question: I've been suggested to "mind my own business", should I report this bug or not?...I think I'm too stupid not to point them at the fix...
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 17, 2013, 05:54:55 pm
Sorry, no success message.  :( 
Groups to receive: Newsletter (2 Member)
Only one receive the mail.

Groups to receive: Newbie (3 Member in)
Only two of them receive the mail.

Groups to receive: All checked (3 Member overall)
Only two receive the mail.

Big thanks for your tireless assignment!!
Title: Re: Send out Newsletter failed
Post by: emanuele on December 17, 2013, 06:29:51 pm
I found some other bugs around and a mostly duplicated function, now is a bit late, I'll try to fix everything tomorrow... :(
Title: Re: Send out Newsletter failed
Post by: emanuele on December 18, 2013, 03:50:50 pm
NetFlag, just to be 100% sure, are all the three members activated?
If you go to the member list (the public one at ?action=memberlist) do you see the three of them?

I'm asking because there was a bug that was counting non-active members too, but apart from that I can't reproduce the issue... :-\
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 18, 2013, 06:04:41 pm
All members are activated and visible in public meberlist.

New upload overall files from current available Github:
https://github.com/elkarte/Elkarte

Patch included:
https://github.com/emanuele45/Dialogo/commit/304e22dd368c6386428c1b65583a4da593a32215

Apparently I'm the only one had the problem. No one else??
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 19, 2013, 01:28:01 pm
Compared with SMF there is a missing variable called $normalGroups. Cant find another approach.

I have installed an test SMF too. No problems with send out newsletter.

/me php != php
ElkArtes' Code is much different to mybb. For me some difficulties to read it.

Still learning...
Title: Re: Send out Newsletter failed
Post by: emanuele on December 19, 2013, 07:09:37 pm
Okay, let's try to reproduce the thing on a similar system.
You have a clean install, right?
3 users: one admin and two in a group "newsletter"? (Is it a normal group? Something special about it in terms of settings?)
Other "special" settings? (Dunno, deny permissions on, or post-based groups permissions? Things like that.)
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 20, 2013, 04:14:38 am
No special settings. The group "Newsletter" is additionel, inherit from "normal members".
One admin.
The other two are members in "normal menbers" and "Newsletter". The goal is to send emails only to members of group "Newsletter".
The problem, only one of them recieve.
Title: Re: Send out Newsletter failed
Post by: emanuele on December 20, 2013, 09:24:05 am
Can you try with the attached sources dir? ???
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 20, 2013, 09:40:16 am
From this morning till now I test with this mail problems. I found it. Mea culpa that I need this long time to figured it out.

The only reasen to this problem was a wrong emailadress for one of my member. Goof!
Now I can say ElkArte works.

Im so sorry. I did not expect to wrong emailadress.

I asked myself:
Why is this not written in errorlog?
Answer:
The mailadress exists. A noninvolved get spamed by me. oh, my goodness....

/me could kick himself.
It really does sadden me that you emanuele have unnecessary work with me.
Title: Re: Send out Newsletter failed
Post by: emanuele on December 20, 2013, 10:15:07 am
lol
It happens! ;D

No problem, the first bug was absolutely legitimate! And while debugging the non-bug I found and fixed several other things (and hopefully improved a tiny bit a nasty function).

Well then, time to merge!
Title: Re: Send out Newsletter failed
Post by: NetFlag on December 20, 2013, 02:17:38 pm
Quote from: emanuele – ...
 And while debugging the non-bug I found and fixed several other things (and hopefully improved a tiny bit a nasty function).
...

Glad to read the whole has actually something good. Thank you for your understanding.

@ALL
Have a nice weekend, merry Christmas and a happy new year!

/me away from keyboard from 12.21,2013 till 01.07,2014  8)
Title: Re: Send out Newsletter failed
Post by: emanuele on December 22, 2013, 09:27:36 am
/me is a bit late for NetFlag's merry Christmas (he is already away... :()

Oh well, happy 2014 NetFlag and all!