Most mentioned links:MMBase documentation
MMBase Taglib reference
The reference for all tags mm
Following up on my previous posts about mail I will now introduce you to spamming a group of users. Mailing several people at once is done by relating an email to a node - for example a groups node - with related users.
A group can have several forms: like for example an article with users that have subscribed themselves to be aknowledged of any comments. Or like the default implementation: a 'pools' node with related users.
If you wish to change the default 'pools' and 'people' nodetypes to something different you can do so by changing some properties in the email builder. The only requirement is that the related nodes representing the users should have a field with a valid email address specified in the property 'users-email-field'.
Create an email, like in one of the previous tips.
<mm:createnode id="email_node" type="email">
<mm:setfield name="subject">Hi, I invite you all to...</mm:setfield>
<mm:setfield name="from"> email@example.com </mm:setfield>
Refer it to a group node which has has related user nodes with a field 'email'. You can to this for example when someone posts a comment and mail it to all users who subscribed.
<%-- relate the newly created email to a group --%>
<mm:node id="group_node" number="group_alias" />
<mm:createrelation source="email_node" destination="group_node" role="related" />
<%-- send the email --%>
<mm:function name="mail" />
The mail is send immediately after it is related to the group node.
I choose 'oneshotkeep' since this keeps the email as a node in mmbase and can be used to build a mail archive.
0 comments | leave a comment ↓