Support

Home Forums Event Espresso Premium Unable to resend message after error

Unable to resend message after error

Posted: May 4, 2022 at 2:40 pm


stijl

May 4, 2022 at 2:40 pm

Hi,

I have some messages that produced an unknown error. The messages have status “mrt”. However, resending them with the “Send Immediately” button produces an error: “No message was sent because of problems with sending. Either all the messages you selected were not a sendable message, they were ALREADY sent on a different scheduled task, or there was an error.”.

After some debugging I found that the problem seems to lie in “EE_Messages_Queue.lib.php”. In the function “execute” it checks if the message status is eligible for sending: “if (! in_array($message->STS_ID(), EEM_Message::instance()->stati_indicating_to_send())) {“. However, the array returned by “stati_indicating_to_send” does not contain the “mrt” status code (only “mid” and “mrs”), which seems odd. Is this a bug, or is this intentional and is the error somewhere else?

Btw, I’m not sure if this forum is the best place for this type of developer-oriented bug reports. If there is a better place, let me know!


Joao Victor

  • Support Staff

May 9, 2022 at 2:00 pm

Hi there!

Thanks for contacting us!
We are happy to help.

In order to assist you better, could you provide me with the step by step to allow me to reproduce this error?

Thanks!


stijl

May 12, 2022 at 8:50 am

Sure!

Step 1: Have a message with the MRT status (occurs after a wp_mail failure, I think). (Simplest is probably to do this in the DB: For any message, set STS_ID in the wp_esp_message table to MRT.)
Step 2: In the Messages admin page, locate the MRT message and press the “Send Immediately” button (it has the >> icon) on the right.

Then the error message appears and the message has not been sent.


Joao Victor

  • Support Staff

May 17, 2022 at 11:57 am

Hi there!

Thanks for contacting us!
Could you please provide us with temporary WordPress credentials as a private reply? We want to go through your Dashboard to check the MRT messages and the reported error.

Thanks!


stijl

May 22, 2022 at 4:11 am

I don’t think I’m able to do that due to European privacy regulations. Does this mean that you are unable to produce the reported error? The code suggests that this error always happens when sending any MRT message.


Tony

  • Support Staff

May 23, 2022 at 6:04 am

Hi there,

I can reproduce this locally, however, currently, Event Espresso intentionally ignores the above status within the message queue and the reason we do that is we found some mail server configs returning an error on sending…. but actually sending the email.

That meant that every time the message queue tried to trigger the above message to send, it caused a ‘duplicate’ message to be sent even though the mail server still returned an error on sending (logically, that means the email shouldn’t have sent). As that ‘can’ happen every 5 minutes we chose not to include those messages in the default sending stati within the automated queue and that is why it is not included within stati_indicating_to_send

Now, that’s not to say this isn’t a bug (I believe it is) but the fix isn’t as simple as including the above stati as mentioned, it should only be included when messages have been manually triggered.

I’ll create a ticket for our developers to investigate this further and see what is going on but you ‘can’ add that status to stati_indicating_to_send via a filter if you would like to?

Here is an example: https://gist.github.com/Pebblo/a539d5c5ec9b6101543854a6dee69267

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


stijl

May 26, 2022 at 1:41 pm

That makes sense. Perfect, thank you!


Tony

  • Support Staff

May 31, 2022 at 8:38 am

You’re most welcome 🙂

The support post ‘Unable to resend message after error’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso