Minor fix adding tag for new rule.
[project/election.git] / election_vote / election_vote.rules_defaults.inc
1 <?php
2 /**
3 * @file
4 * Default Rules for the Election Vote module.
5 */
6
7 /**
8 * Implements hook_default_rules_configuration().
9 */
10 function election_vote_default_rules_configuration() {
11
12 $items = array();
13
14 // Display a message to notify the user after abstaining.
15 $items['election_vote_notify_abstainer'] = entity_import('rules_config', '{ "election_vote_notify_abstainer" : {
16 "LABEL" : "Notify user after abstaining",
17 "PLUGIN" : "reaction rule",
18 "TAGS" : [ "election" ],
19 "REQUIRES" : [ "rules", "election_vote" ],
20 "ON" : [ "election_vote_abstain" ],
21 "DO" : [
22 { "drupal_message" : { "message" : "You have abstained from voting ([election:type:post-name]: \u0027\u003Ca href=\u0022[post:url]\u0022\u003E[post:title]\u003C\/a\u003E\u0027)." } }
23 ]
24 }
25 }');
26
27 // Display a message to notify the user after voting.
28 $items['election_vote_notify_voter'] = entity_import('rules_config', '{ "election_vote_notify_voter" : {
29 "LABEL" : "Notify user after voting",
30 "PLUGIN" : "reaction rule",
31 "TAGS" : [ "election" ],
32 "REQUIRES" : [ "rules", "election_vote" ],
33 "ON" : [ "election_vote_vote" ],
34 "DO" : [
35 { "drupal_message" : { "message" : "Thank you for voting ([election:type:post-name]: \u0027\u003Ca href=\u0022[post:url]\u0022\u003E[post:title]\u003C\/a\u003E\u0027)." } }
36 ]
37 }
38 }');
39
40 // Prompt the user to share the election on Facebook or Twitter after voting.
41 $items['election_vote_share'] = entity_import('rules_config', '{ "election_vote_share" : {
42 "LABEL" : "Prompt user to share the election on Facebook or Twitter after voting",
43 "PLUGIN" : "reaction rule",
44 "TAGS" : [ "election" ],
45 "WEIGHT" : "1",
46 "ACTIVE" : false,
47 "REQUIRES" : [ "rules", "election_vote" ],
48 "ON" : [ "election_vote_vote" ],
49 "DO" : [
50 { "drupal_message" : {
51 "message" : "You can share this [election:type:name] on \u003Ca href=\u0022http:\/\/www.facebook.com\/sharer\/sharer.php?u=https:\/\/[site:url-brief][election:url]\u0022 target=\u0022_blank\u0022\u003EFacebook\u003C\/a\u003E or \u003Ca href=\u0022http:\/\/twitter.com\/share?text=I%20voted%20in%20[election:title]%20-%20https:\/\/[site:url-brief]%20([site:name])\u0022 target=\u0022_blank\u0022\u003ETwitter\u003C\/a\u003E.",
52 "repeat" : 0
53 }
54 }
55 ]
56 }
57 }');
58
59 // Email the user after voting.
60 $items['election_vote_email_voter'] = entity_import('rules_config', '{ "election_vote_email_voter" : {
61 "LABEL" : "Email user after voting",
62 "PLUGIN" : "reaction rule",
63 "WEIGHT" : "2",
64 "ACTIVE" : false,
65 "TAGS" : [ "election" ],
66 "REQUIRES" : [ "rules", "election_vote" ],
67 "ON" : [ "election_vote_vote" ],
68 "DO" : [
69 { "mail" : {
70 "to" : "[account:name] \u003C[account:mail]\u003E",
71 "subject" : "Thank you for voting",
72 "message" : "You successfully cast a vote, using the system at: [site:url]\r\n\r\n [election:type:name-ucfirst]: [election:title]\r\n [election:type:post-name-ucfirst]: [post:title]\r\n Time of vote: [site:current-date:long]\r\n\r\n(for security reasons further details are not displayed)\r\n\r\nIf you have any queries relating to this information, please contact us.",
73 "language" : [ "" ]
74 }
75 }
76 ]
77 }
78 }');
79
80 return $items;
81 }