Hi,
i use drupal for a few Years now and use mailhandler to post news to my page via e-mail.
Lately i realized that e-mail that i send to my homepage do create new News but they are not send out as newsletter. They are in the correct category and when i edit the e-mail-created page and press the submit button without changing anything they are send out.
It seems that they are not normal news until i edit them because the are not displayed on admin/content/simplenews as well.
Is this a bug or is this intended and if it is a Bug is it a simplenews or a mailhandler bug?

Greetings
Angel

CommentFileSizeAuthor
#6 submit_without_form.patch1.11 KB1st-angel

Comments

sutharsan’s picture

All simplenews newsletters should be listed under either admin/content/simplenews/ or admin/content/simplenews/notsent. Do you use Localizer module?

1st-angel’s picture

OK, the news is listed under admin/content/simplenews/notsent. can you tell me why it is not send?

1st-angel’s picture

The "Default send action:" under admin/settings/simplenews/newsletter is set to "Send newsletter"

sutharsan’s picture

When you save the node using the node add/edit form and the newsletter is send depending on the 'Default send action'. I have no experience with creating a node using mailhandler.

z.stolar’s picture

AFAIK simplenews is not behaving like any other node type. It adds/removes some control of the node edit.
Are you trying to send a mail to your site, which will be immediately sent out to your subscribers? If you do, you might want to check our listhandler module.

1st-angel’s picture

StatusFileSize
new1.11 KB

hi,
i just "fixed" the problem for me.
The problem was that mailhandler does not create a form. When simplenews-nodes are submited simplenews reads values from the form and saves them to the database. If there was no form all the values are empty and mysql-default-values are saved to that database fields.
My patch simply inserts the default values to the node in the 'validate' step if they are empty.
This way the simplenews-default-values are saved and the mails are send out.

I don't know if this is the correct approach to the problem but it works for me.

Could someone please review the patch and tell me if my patch is OK.

thanks
Angel

z.stolar’s picture

You can implement hook_mailhandler in simplenews.module, and this will allow you to pass simplenews the necessary commands (like a "send" command which will have "not now, to test, now" as optional values)

1st-angel’s picture

hi,

i thought about this. But that would only solve this problem with mailhandler. If you use simplenews whith other modules the same problem will occur.

sutharsan’s picture

Status: Active » Closed (won't fix)

I will not commit this patch. The solution of z.stolar would be the better approach.

jonathanbloom’s picture

I'm curious as to how to implement the hook. Do I just add hook_mailhandler somewhere in simplenews.module?

kuemerle5’s picture

What exactly would the content of the 'hook_mailhandler' method look like if it only needs to tell Simplenews to parse an email as sent?

sutharsan’s picture

To find out how to implement a hook_mailhandler, you can study the Mailhandler module and modules which already implement hook_mailhandler. For the latter see: Casetracker, mail2web and mailsave.

kuemerle5’s picture

Alright, thank you very much. Hopefully I can get this working and if I do I'll see if I can upload a patch (and maybe you could apply it =).