Active
Project:
Simplenews
Version:
7.x-1.1
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Jul 2013 at 07:03 UTC
Updated:
1 Sep 2015 at 12:03 UTC
Jump to comment: Most recent
Comments
Comment #1
strainyy commentedAny luck with this? I'd like to achieve the same thing...
Comment #2
strainyy commentedI've managed to create a new Newsletter whenever a user adds a taxonomy term of a certain type. Maybe this will help you work out how to do it with nodes.
Within your rule configuration, create an action of the type "Execute Custom PHP Code".
Enter the following code, but omit the
tags as they are just for formatting this comment.And to delete the category when a certain taxonomy term is deleted create a new rule that reacts to the taxonomy term deleted event. Again, create an action of the type "Execute Custom PHP code". Simply place the following code in the text area:
Once again, remember to delete the openning and closing PHP tags as they are just for formatting in this comment.
Hopefully this helps anyone having the same sort of SimpleNews automation issues.
Comment #3
olak commentedi have a similar usecase. when a node of certain type is created, i'd like a new newsletter category of the same name. as i understand, creating a taxonomy term of "newsletter" doesnt create a newsletter. you have to add it in admin/config/services/simplenews/add
and i dont see such an action in simplenews rules. @strainyy , can you post your whole rule (export it first)? it would be very helpful, to see how you implemented it.
Comment #4
neoxavier commentedActually you dont need simplenews rules to do this.
In rules action, you need to pick create "new entity" then pick "simplenews Newsletter" as entity type
Note: in version 2 simplenews use entity rather than taxonomy category. in version 2 there is no newsletter category
Comment #5
techn0guy commented@neoxavier
I don't see this option under the new entity field, am I missing something here? Also when I try using the custom PHP code, the name of the newsletter category doesn't populate... when looking into the module code it seems that a taxonomy term needs to be create too, but I can't get that to work
Comment #6
neoxavier commented@techn0guy are you using simplenews version 2, because the version 1 uses taxonomy category and version 2 uses entity
Comment #7
sebastixThis is how I managed it to get a working solution (version 7.x-1.1) to create a Newsletter category on a node save event:
Before the action where the PHP code is executed from #2 I've added these actions:
1. Fetch new entity (entity type: Taxonomy term)
2. Save entity (force save checked on true)
The taxonomy term name and category name are the same as the provided node:title value.
The export of my rule: