Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Newsletter SS3 - Getting newsletters to SEND!


Go to End


10 Posts   4333 Views

Avatar
novaweb

Community Member, 116 Posts

12 March 2013 at 9:57am

Hey Team,

Have installed newsletter via composer, and also installed message-queue and added the following to my _config.php

MessageQueue::add_interface("default", array( "queues" => "/.*/", "implementation" => "SimpleDBMQ", "encoding" => "php_serialize", "send" => array( "onShutdown" => "all" ), "delivery" => array( "onerror" => array( "log" ) )));

(I'm not sure if "default" is meant to be a placeholder for the intended configuration.)

As per the doc on GitHub.

My problem is, the messages are Queued for Sending, but remain in a "Sending" state... and never actually send.

If someone can help me out I will happily document getting newsletter/messagequeue working together nicely and submit it back to SilverStripe so people have a guide to follow in future.

Avatar
Peavers

Community Member, 20 Posts

15 March 2013 at 9:58am

Edited: 15/03/2013 10:07am

Would also really like to know how to sort this out. I can't seem to find any error logs or debugging information is to why they are not sending. If I remove message-queue (as its not required, only recommended ) I just get a "Failed" message instead of "Sending".

I also note that under the Sent Newsletter tab, clicking on a previous newsletter it says "Send To (none)" instead of the mail list it was supposed to use.

This is on the latest 3.05 install.

Avatar
nos4a2

Community Member, 2 Posts

15 November 2013 at 3:20am

Hi,

Does anyone have a solution for this? Without messagequeue module everything works, but with this module the messages stay scheduled forever. What am I missing??

Thanks,
Christoph

Avatar
Sygmoral

Community Member, 46 Posts

10 May 2014 at 6:43am

I have this issue too now. Newsletters stayed as "Scheduled", and restarting the queue didn't make a difference. I had to remove the messagequeue module to get the newsletter to actually send.

But 4 months ago it worked perfectly. Because of that, I think it has something to do with permissions: I reduced a lot of the permissions recently, giving apache only read access to everything (except the upload folder and language files). Can't immediately get it back to work though.

Does MessageQueue require write- or execute permissions anywhere? Or does any user other than the default apache user need certain permissions? (since MessageQueue sends outside of php execution)

Avatar
luuk

Community Member, 15 Posts

5 October 2014 at 2:22am

Have you guys found any solution to this? i'm having the same problem..

Avatar
Sygmoral

Community Member, 46 Posts

5 October 2014 at 10:08am

Edited: 05/10/2014 10:11am

I did in fact find a solution (on some forum somewhere): seems like the issue is (or was for me at least) that MessageQueue sends the messages asynchonously from you requesting the newsletter to be sent - I mean, it's not called directly from any web request you make. So get this... the issue is that MessageQueue doesn't know where php is.

It is fixed by adding the following to your config.php:

MessageQueue::set_onshutdown_option('phppath', PHP_BINDIR . '/php');

That way, every single time any web page is called, you remind MessageQueue of where php resides.
(in fact, it might be enough to call it just once, but I'm not sure so I just left it in my config)

Avatar
luuk

Community Member, 15 Posts

7 October 2014 at 4:29am

Hi Sygmoral,

Thanks for your reply. I tried it and unfortunately it does not work for me. This is my _config.php file.

// Email queue settings
MessageQueue::add_interface("default", array(
    "queues" => "/.*/",
    "implementation" => "SimpleDBMQ",
    "encoding" => "php_serialize",
    "send" => array(
        "onShutdown" => "all"
    ),
    "delivery" => array(
        "onerror" => array(
            "log"
        )
    )
));


$path = PHP_BINDIR . '/php';
MessageQueue::set_onshutdown_option('phppath', $path);

The github repo sais: "processOnShutdown option requires *nix or OS X (won't work on Windows)". Could this be te problem? i tried the code above both on a mamp installation on my mac and on my webserver. that's configured by a webhost so i don't know the environment.

i really have no idea what to do next...

Avatar
Sygmoral

Community Member, 46 Posts

7 October 2014 at 4:53am

I guess it may be an environment issue indeed then... I'm afraid I'm no expert on the subject, I was just happy I got it to work for myself :/

I am personally on a linux host that I can manage myself, and the line I mentioned is the only configuration I've done for MessageQueue. I didn't need any `add_interface`, which is probably because the newsletter module does that for me. If you are on a shared webhost, it might be that they do not allow execution outside of normal web requests? Even so, I suppose it should work on your mamp then.

If no one more experienced can weigh in, I'm afraid you may have to dig into the MessageQueue class and whatever way it uses to queue the messages, to debug the issue!..

Go to Top