Newsletter plugin

Newsletter plugin, a forum discussion on Jojo CMS. Join us for more discussions on Newsletter plugin on our Plugin Support forum.

Back to Forum Index : Back to Plugin Support   RSS
searchmaster

26 Jun 2009
Posts: 19

Big long post...

I have been doing a number of upgrades on the newsletters plugin, but I have the following questions and discussion to help me further enhance it:

Newsletter stuff

Summary:

1. Need to be able to have a new manytomany relationship for newsletter users with the usergroups table - but what field in the users table can be used as a view in newsletteruser to store such a relationship.
2. Need to be able to have a new manytomany relationship function, that allows for information to be added to the relationship table, not just checkboxed - for use with the user attributes function
3. Need the ability to have that manytomany function (per 2 above) to also save to the users table as firstname/lastname.

How can I do the above?

Discussion:

User attributes
There is the concept of user attributes in phplist

ie firstname, lastname, organisation

Phplist_user_attribute stores the attribute definitions

And phplist_user_user_attribute stores the usernumbers and id's of the attributes

This function is the same as the usergroups function of users, and the newslettergroups function.

However, both of the many to many list relationship only allow for those groups to be checkboxed. With the user attributes, I want the to not just select the "firstname" attribute, but I want to put something in it.

How can I have such a many to many relationship?

But why is it needed??? - I have been using it since it exists. However, I have added a new view onto the newsletteruser table to include the firstname/lastname, and this is now as editable fields in jojo.

However, when you send newsletters, you are able to add placeholders per http://docs.phplist.com/Placeholders, and it is not possible to use the jojo firstname/lastname items, since they are not linked with the manytomany relationship of the attributes.

Therefore, we need to be able to use user attributes to include personalized information into newsletters.

The problem with the view including firsname/lastname of the users table - and the attributes concept existing sidebyside
- How can we populate the user attributes (ie we can use the manytomany), but also populate the user table with the firstname/lastname ???



Many to many inside jojo
I see that for a many to many relationship, there is the following:
- Phplist_listuser - stores the userid and listid when "save" is pressed
- Userid - from the main table
- Listid - from the phplist_list
- Phplist_list - it gets the items from here and shows them in a checkbox format - used for newsletter groups, and usergroups membership

This information is stored in jojo fielddata, but needs to have a field to place the above relationship in - ie in edit fielddata, the above many to many relationship is stored in the groups field.

Therefore:
Newsletter users are part of the users table, but they do not have a usergroup associated with them. They need to have a newsletter usergroup, and for that usergroup to be a checkboxed selection in "edit newsletter users".
a. Therefore, we need an additional field in the newsletteruser table to be able to store this relationship. But the newsletteruser table is a view of users table. Therefore can we can grab a random field from the user table, like foreignkey, or extradata, and use this for making a new many to many checkbox selector for the usergroup. Could we use which of the foreignkey/extradata fields for this???


Jaijaz Jaijaz

8 Jul 2009
Posts: 215

Ok so this is my second attempt as my last post timed out and got lost.

From reading your post, it appears that your overall objective is to be able to include personalised information in the body of the email. This is what I suggest to achieve that.

After talking to the gardine boys a while back and from my own expirence with the plugin, it was originally designed that custom subscribe fields would be handled with a fields.php file like the contact plugin uses, however it hasn't been fully implimented and in reality there is code sitting there for it that isn't being used. I have been planning on finishing this but haven't had time to give it. My plan is to have standard stuff like first, last name and email etc go into the user table as per how you have currently added. Any none standard fields, I proposed be held in a serialised form in an "extrainfo" field. As the phplist attributes are currently used in the plugin this would mean less mess and should mean you don't need the many to many fields etc.

Once that is implimented, using the personal information in the email, is as simple as passing all the info to smarty and using it in the email body tpl file.

I am interested in anyone else's thoughts, as I feel like giving that all a go over the weekend while I stay up late watching the tour de france. ;)
If you not living on the edge you taking up too much space.
Back to Forum Index : Back to Plugin Support   RSS
You must be logged in to post a reply



You need to Register or Log In before posting on these forums.