Multiple emails are being sent

We are getting multiple emails being sent to random clients from this plugin. Sometimes twice a day and I am not sure where to start.

Has anyone else had this issue before?

  • Alexander
    • DEV MAN’s Mascot

    Hi @atjuch,

    Can you try updating to the latest version? (2.4.7) A bug was fixed that involved emails being sent prematurely from categories before they were saved. This could be related to your problem. There were also several other improvements made.

    Let us know if this helps!

    Best regards,

  • atjuch
    • Flash Drive

    I am still having problems with this happening on random occasions. Currently we are on version, 2.4.9 that was updated I think last week. We will go a week, or several days with the plugin only sending out one email. Then this morning it sent out three separate emails, all of which had the same content.

    Currently our webhost is GoDaddy and we have about 550 subscribers that have joined our mailing list from the plugin. Could it be something on their mail server end or would it be caused by something within the plugin itself?

    I could really use some serious help here guys because we do not want to continue to spam people with multiple emails and would love to get this fixed and track down what the error is.

    We are willing to hire someone to help us because this is a large issue.

    Thank you in advance.

  • Alexander
    • DEV MAN’s Mascot

    Hi @atjuch,

    I've tried a few things here, and this isn't an issue I've been able to reproduce. I'm not sure where we can go from here to test this, but I'll check in with the plugin developer to see if he has any suggestions.

    Thanks for the update!

    Best regards,

  • Ignacio
    • HummingBird

    Hi @atjuch,

    We are releasing a new version most probably this week. It seems that there could be some cases where the plugin sends a duplicated email so we're adding an additional check to avoid that. Sorry for the inconveniences.

    Regards.
    Ignacio.

  • Ignacio
    • HummingBird

    Hi @atjuch.

    Again, all my apologies for the problems this is causing to you. The thing is that we couldn't reproduce that error and the only thing I can do is add an additional check when the emails are sent in order to avoid repeated emails.

    I'd like to release this new version tomorrow as max so if you could set your digest frequency as "Never" during this time, it would stop temporary your sendings for today.

    Did your developer find something in your system anyway? I could apply another patch depending on your findings.

    Regards.
    Ignacio.

  • Alexander
    • DEV MAN’s Mascot

    Hi @atjuch,

    We don't have any support avenues outside of forums or the live chat sessions. However, if there's any confidential info like WordPress or FTP usernames/passwords you'd like to send our way, we can arrange for that via the contact form. Just let us know.

  • atjuch
    • Flash Drive

    Thanks Alexander,

    I am in communication right now with the developer we hired and I asked him to write up in detail of the code changes he added for Ignacio.

    Once I get the write up I will send it over in a .zip file to the contact? Or what is the best way to go about getting everyone on the same page?

    Thanks!

  • Ignacio
    • HummingBird

    Hi @atjuch.

    Could you attach it here as soon as possible? We'd like to release the new version tomorrow but if I see that your changes are heavy, we'd have to delay it until next week as I'll be off from friday to monday and I would not like to release a new version while not being here, just in case.

    Regards.
    Ignacio.

  • atjuch
    • Flash Drive

    Ignacio,

    Here is where we are at:

    1. We had the plugin run with the updated code this morning and it did not work, it sent out two emails to all of our 500+ subscribers. You can see this from the screen shot I have attached below.
    2. We would like to test out your update as soon as possible, if you can attach it here I can download it and install a new version of the plugin.
    3. My boss would also like to know how we can be in direct contact with you because this is becoming an extremely delicate issue with our website, we need to get this fixed today. We have clients emailing us complaining about duplicate emails, it's getting worse.

    Here are some questions I have for you:

    - We would like to test this during the day. Is there a way we can force test the option to send out the email within the past 24 hours to see if your fix worked without waiting until the next day?

    Thank you for all of your help, we really could use some help!!! Thanks :slight_smile:

  • Ignacio
    • HummingBird

    Hi @atjuch.

    Here attached is the version that we want to release though we are gonna do some little changes but nothing related to sendings.

    I've added a triple check when sending emails just in case. If your system is still duplicating the sendings we'll have to check in another part. This issue was totally solved some versions ago and nobody had problems with it again. We have done tons of testings so I hope it works for you.

    You have a way to trigger the digest. You'd need to go to the options table of your blog ( if your blog ID is 32, then the table is called wp_32_options, if your site is not a multisite then the table name is just wp_options), then look for this option_name: "next_day_scheduled" and set it to 1. This will trigger the sendings next time you refresh the site.

    Just another question: Are you using any cache plugin?

    Unfortunately I cannot give personal support outside of the forums.

    Regards.
    Ignacio.

  • atjuch
    • Flash Drive

    Ok, I have set the "next_day_scheduled" to 1 and clicked Go, it updated the database.

    - I imported an email list that has 106 emails that we manage on it
    - I set the batches to 25 emails every 30 minutes
    - The first batch of 25 emails were successful but I am not seeing the email in any of the first 25 inboxes at all

    What else do I have to check?

  • atjuch
    • Flash Drive

    Found out that it has to do with our hosting provider, GoDaddy. Since we had 500 subscribers today and have done testing and such, it maxed us out.

    It seems that we can only send out maximum of 1,000 emails per day.

    I am currently on the phone with them figuring out what we could do..I will keep you posted.

  • Alexander
    • DEV MAN’s Mascot

    Hi @atjuch,

    Thank you for the additional info here. I'm sorry for the delayed response here. Good to hear you were able to track down part of this issue, and discover the GoDaddy issue.

    I'm not sure about this recent problem, but will check back with @Ignacio about it.

    Best regards,

  • atjuch
    • Flash Drive

    Hi @Ignacio,

    We are still having trouble sending out emails, the plugin worked for a few days then sent two reports the same day so our subscribers received (2) emails that day.

    I have disabled and uninstalled the plugin because I don't know what else to do.

    Thank you for all of your help, you have tried very hard to get the issue resolved. At this time we need to find a solution that works.

  • gilad
    • Site Builder, Child of Zeus

    Hey @Ignacio

    I upgraded to the latest version. test email ws sent once (which is good), but i still recieve notification emails 3 times (user subscribes/unsubscribes).

    I'm affraid if i add all my subscribers again they will recieve 3 emails also.

    Any ideas?

  • Ignacio
    • HummingBird

    Hi @gilad.

    Would be possible to take a look closer inside your system?

    Can you please send in:

    - Mark to my attention
    - Link back to this thread
    - Include admin/network access
    - Include cPanel (I will need to look at the DB so need PHPMyAdmin or similar)
    - Include FTP
    - Include any relevant URLS for your site

    https://premium.wpmudev.org/contact/
    (Select "I have a different question" option)

    I'll add an internal log and check. I'll need to create some test posts. Let's try to fix it before the weekend.

    Regards.
    Ignacio.

  • gilad
    • Site Builder, Child of Zeus

    Hey @Ignacio

    I've sent you the contact details, but i think may found the problem.

    If i had 3 SuperAdmins and the 'Get notifications' setting was set for SuperAdmin, i would get 3 notifications. If i had 2 SuperAdmins i would get 2, etc...

    This might solve the problem all together.

  • gilad
    • Site Builder, Child of Zeus

    Hey,

    It still sends out 2 mails. I think it's a time problem.

    This is what i did.

    I wanted the digest to be sent out at 22:00 (as you can see in the screen shot attached), 'The time is now XX:XX' is correct. but if i set the 'What time should the email digest be sent' to 22:00, it sends it out at 20:00. if i set it to 00:00 (like in the screen shot), it sends it out at 22:00 (like i want) but it sends out another one at 00:00.

    Something is wrong the times.

    As you can see in the screenshot, next digest will be sent at 2:00. why?!

  • Ignacio
    • HummingBird

    Hi @gilad.

    I'm working on it although I didn't see anything strange. I could get the digest sent at the right time. Your next digest will be sent at 2013-12-24 00:00:00 unless nobody visit your site at that time so if someone visit the site at 01:00, the digest will be sent at that time. I've subsribed myself and need to check the CSV you uploaded (I sent you an email for that).

    Regards.
    Ignacio.

  • Ignacio
    • HummingBird

    Hi @gilad.

    I don't understand that yet. So you get an email at 22:00 an danother at 00:00? Is it possible that you're getting those emails from different sites in your network?

    I've added a debug trace to the plugin in your site. When the digest is triggered in your main blog (ID = 1) everything will be written in a file called sbe_debug.log. I'll take that file and study it.

    Meanwhile, I'm fixing the CSV stuff.

    Regards.
    Ignacio.

  • gilad
    • Site Builder, Child of Zeus

    That's exactly what happens.

    I thought about what you said - "Is it possible that you're getting those emails from different sites in your network?"

    But it only sends post from the main site. All other sites in the network are not updated at all.

    Thanks for all the help!

  • Ignacio
    • HummingBird

    Hi @gilad.

    I'm checking the log yet I don't understand what's going on. The plugin is sending one at 22:00 when the time set is at 00:00 but there's a moment that the time changes to 22:00, don't know why. Batches are not working too but I don't have enough information in the debug file.

    I think I could make more tests but I'd need to remove most of your subscribers temporary during this morning. I'd like to manually trigger the daily digest. I won't be working tomorrow and probably not in 26th morning and today is going to be a busy day in my house :slight_smile: so I'd likke to solve this during this morning or at least gather more information about what's going on there.

    So, can I remove your subscribers? I'd make a backup of them and then restore the list again.

    Regards.
    Ignacio.

  • Ignacio
    • HummingBird

    Ok, I think I saww something: You have a batch of 600 in the SBE settings. I'm sure this is causing a timeout in the execution of the sendings. So, I see that the digest tries to send 600 emails but when it gets 178 it stopped and tried again later with same results. Because execution didn't finish, the emails were sent again.

    First of all, we should set the batch to 90-100 as max. SBE will include other sendings systems in future releases so you will be able to send more emails but this is what we have at this moment, this is a small plugin that cannot handle so many subscribers. So, you will be sending 100 emails every 30 minutes. If you have 600 subscribers, the digest will take about 3 hours to be finished. I can try with 20 minutes instead of 30 so it finishes early.

    Anyway, I'm going to remove your subscribers and see.

    Regards.
    Ignacio.

  • gilad
    • Site Builder, Child of Zeus

    OK.

    This might explaine what happend tonight, but doesn't explaine the problems before.

    I changed it to 600 yesterday.

    Anyways, let me know when you finish testing so i can configure the settings again.

    Thanks

  • Ignacio
    • HummingBird

    Hi @gilad.

    Thanks a lot for your patience.

    I think I got something and the server of your site is involved. The PHP function date() is returning different dates in every refresh. The plugin saves next time that the digest has to be triggered in the database. So, for instance, currently, your site has this date in Unix format:

    1387965600

    Then, if I want to transform that date into a human readable date I can use this:

    date( 'Y-m-d H:i:s', 1387965600);

    That should return something like 2013-12-25 12:00.

    But sometimes return a different date. this is the log:

    2013-12-25 10:00:00
    2013-12-25 12:00:00
    2013-12-25 12:00:00
    2013-12-25 12:00:00
    2013-12-25 10:00:00
    2013-12-25 12:00:00
    2013-12-25 10:00:00

    See? Sometimes return the actual date and sometimes a two hours ago date. That's why the plugin was sending the digest two hours in advance and because the sending could not finish, it tried to send the same digest two hours later (so you got two emails.

    So, the problem should be fix if you set a batch of 90-100 but you should talk to your hosting and tell them that date() function is returning different dates in every refresh, this could cause some issues too.

    Meanwhile you should know that if you want to send a digest at 23:00.

    Now that I see, the logs are deleted before 31 days, don't know why but I guess that is related to the date function too. I'm still testing to see what's happening with the logs.

    Regards.
    Ignacio.

  • Ignacio
    • HummingBird

    Hi again.

    I restored your subscribers, set the batch to 90 and the time difference between batches to 20 minutes. You'll have some "dates dancing" anyway because of the date() function malfunctioning, the logs does not reflect the exact date of the digests but at least they are sent just once. I also fixed the deletion of the logs. They were being deleted always.

    I think everything will work fine tonight. I've let the debug file in your system just in case. I'll try to check it tomorrow but I will be mostly off the entire day.

  • Ignacio
    • HummingBird

    Hi @gilad.

    Sorry to hear that again. I've checked the debug file and I've seen that date() function is causing that issue because is returning different dates in each refresh. It seems that because the digest is set at 00:00, that's when a day changes and it detects that it has to send the next day digest. It's a very odd issue.

    What I'd do is stop the digests until your hosting has an answer for you. Set the digest as "Never" and wait for a response. Then tell me what did they tell you and we'll apply a patch depending on their answer. There's a solution by changing some things in the plugin and using another function instead of date but I'd need to make more changes yet date() should be working fine.

    Regards.
    Ignacio.

  • gilad
    • Site Builder, Child of Zeus

    Hey,

    For now, Yes. Eveything went OK. I changes the time of the digest to 20:00 (which sent the emails at 18:00, but that's the server issue).

    I want to wait untill tomorrow morning to confirm that all is good.

    Thanks

  • gilad
    • Site Builder, Child of Zeus

    Hey @Ignacio

    It seems that everything is working fine now.

    As you said, there was a problem with the time on the server. I've set the digest to an earlier hour and it works fine now.

    Thanks for all you help!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.