Mailgun_mailin

Thank you for the excellent mailgun_mailin plugin.

I'm not being successful in passing the necessary parameters to the plugin in the incoming email. For example, emailing in a discussion to a group works fine - with the subject line being picked up as the title of the discussion, and the body of the email as the content of the discussion - but, for example, including

TAGS: sometag

in the body of the email, isn't picked up by the parser. ...would very much appreciate any suggestions :)
With thanks

Jamie

  • Thanks again; please excuse my incompetence...!

    Interestingly, it never reaches that code. In fact, if I take that file away entirely, nothing changes! Discovered this after some lengthy tinkering with it :)

    This error is thrown :-

    [Sat Aug 05 07:52:52.805335 2017] [:error] [pid 441] [client 192.168.3.2:59688] PHP WARNING: 2017-08-05 07:52:52 (NZST): "Argument 1 passed to ArckInteractive\\Mailgun\\Message::__construct() must be an instance of stdClass, array given, called in /var/www/elgg/mod/mailgun/classes/ArckInteractive/Mailgun/MGWrapper.php on line 259 and defined" in file /var/www/elgg/mod/mailgun/classes/ArckInteractive/Mailgun/Message.php (line 27)


    ...interestingly, even without Mailgun.php present the content automatically ends up being successfully posted as a discussion, giving the subject line of the email as a discussion title, and the body of the email as content. But how is this happening? Somewhere else, this must be being parsed, and the decision made that it's a discussion (does it default to that?) ...and that the subject line of the email is the title, and the body the content.

    Thank you again for your much-valued help - my apologies for where confusion is apparent in this...

    Jamie

  • Further on this one. I've upgraded to php 7.1 in case that was the problem. Now, Mailgun.php is referenced, and the previous behaviour of it posting in any case as a discussion has disappeared; now it doesn't post at all. This error is thrown (similar to the above)

    [Sun Aug 06 16:36:33.386244 2017] [php7:notice] [pid 32186] [client 192.168.3.2:58845] Exception at time 1501994193: TypeError: Argument 1 passed to ArckInteractive\\Mailgun\\Message::__construct() must be an instance of stdClass, array given, called in /var/www/elgg/mod/mailgun/classes/ArckInteractive/Mailgun/MGWrapper.php on line 259 and defined in /var/www/elgg/mod/mailgun/classes/ArckInteractive/Mailgun/Message.php:27\nStack trace:\n#0 /var/www/elgg/mod/mailgun/classes/ArckInteractive/Mailgun/MGWrapper.php(259): ArckInteractive\\Mailgun\\Message->__construct(Array)\n#1 /var/www/elgg/mod/mailgun/start.php(70): ArckInteractive\\Mailgun\\MGWrapper->processIncomingMessage(Array)\n#2 [internal function]: mailgun_page_handler(Array, 'mg')\n#3 /var/www/elgg/vendor/elgg/elgg/engine/classes/Elgg/Router.php(100): call_user_func('mailgun_page_ha...', Array, 'mg')\n#4 /var/www/elgg/vendor/elgg/elgg/engine/classes/Elgg/Application.php(436): Elgg\\Router->route(Object(Elgg\\Http\\Request))\n#5 /var/www/elgg/vendor/elgg/elgg/engine/classes/Elgg/Application.php(384): Elgg\\Application->run()\n#6 /var/www/elgg/index.php(8): Elgg\\Application::index()\n#7 {main}

    The mail contains :

    Subject - DISCUSSION: Some title

    Body -

    DESCRIPTION: Some description

    TAGS: Sometag

    Message

     

    Thanks very much again,

    Jamie

  • Further. So, judging from the output, the error was thrown because an array was passed as constructor argument to class Message instead of a Message object. So I have updated the script to get an array instead of message object. The script no longer throws the error (although the parsing still doesn't happen - but I'll work on that now).

    I'm curious what it is about my set-up that throws this error, but obviously not elsewhere?!

    Cheers, Jamie

  • Greetings

    Is anyone successfully using this mailgun_mailin plugin? I'm still not having any success with the mailed in content being parsed, and would be very keen to touch base with anyone whose got it working, to help find out what's going wrong here.... Please?!

  • Ha! Sorry to reply again to my own post, but finally figured what was happening. One of the issues was due to the 'tag tools' plugin.