I've been reading through the open issued and I saw some issues about exposing the API for managing subscriptions but I'm lookingo to creating newsletters from code.
I was trying to figure out insert_view and simplenews scheduler but I had some problems.
I will handle the views myself (I want to include some views conditionally) and I'll build the HTML I want to send. I couldn't figure out if there is an easy way to send this to all my subscribed users and take advantage of the throttling, per user plain text and unsubscribe features provided by simplenews.
I couldn't find any documentation on this, anyone attepted it before? The code of simplenews scheduler is a a little bit too complex as I don't need to save revisions or anything.
Any advice? Any thread about this? Is there an API for this purpose?
Thanks
Comments
Comment #1
sutharsan commentedIf you make your newsletter a node, assign it to simplenews, add a taxonomy term to it, you should be ready to go.
Comment #2
josepvalls commentedThanks for your reply.
What I understand is that my module will create a new node by code, assign it to simplenews and when I save it it will be sent. I may try it this way but I was wondering if there is a way to just send a message to the subscribers of a newsletter by code.
I'll be sending daily summaries of different sorts of site activity and I don't need to create all those nodes. I'd like the users to be able to subscribe and unsubscibe, use the throttling and so.
Comment #3
sutharsan commentedThere is an issue in the queue to extract and abstract the subscription part out of simplenews. You are welcome to contribute. Simplenews is currently not build to send other content than newsletter nodes.
Comment #4
sapark commentedI think you could do this -- this is from simplenews_nodeapi() in simplenews.module
This sends the newsletter, with an onsreen message that says 'Newsletter Pending', and updates the management console to show 'Sent'. I think this might work, haven't tried it with lots of email addresses.
Comment #5
ragini commentedHi,
I am unable to send mails using simplenews module. When I create Newsletter issue I am getting message called "Newsletter pending". Please can you help me to solve this issue.
Comment #6
sutharsan commentedragini: wrong issue. Search the issue queue or create a new issue with more information.
Comment #7
sutharsan commentedNo activity, closing issue.
Comment #8
geerlingguy commentedI, too, would like to simply be able to send batch daily, weekly, monthly, etc. emails out to sets of users, but without having to create a node for each newsletter (even if I had to create the node, have the email sent, then later delete the node after the emails are sent, that's a bit of overhead and clutter).
It would be awesome if there were a way to simply tell Simplenews to queue up a programmatically-created mail object, regardless of whether it's a node, or something else.
Comment #9
berdirThe new Simplenews Source concept is a start in this direction, abstracting the node however is still quite a bit of work.
We would need to completely abstract the simplenews_mail_spool through the SimplenewsSpoolInterface interface. This should actually be possible but won't be part of 7.x-1.x. You're welcome to work on it, though.
Comment #10
geerlingguy commented(/me is no longer in need of such a feature, as I'm using queue API in D7 and Amazon SES to do batch emails now...).
But this would still be a killer feature; especially if things were abstracted enough to work with any kind of entity.