Salve a tutti, ho creato una "RULE" che invia una email all'utente (autore del post) 30 e 7 giorni prima della data contenuta in un campo.
L'export della RULE è qui sotto ma ho qualche dubbio sul corretto funzionamento. Qualcuno mi può dare un consiglio???
<?php
array (
'rules' =>
array (
'rules_scadenza_rule_' =>
array (
'#type' => 'rule',
'#set' => 'event_node_insert',
'#label' => 'Scadenza (rule)',
'#active' => 1,
'#weight' => '0',
'#categories' =>
array (
),
'#status' => 'custom',
'#conditions' =>
array (
0 =>
array (
'#info' =>
array (
'label' => 'Created content is Scheda',
'arguments' =>
array (
'node' =>
array (
'type' => 'node',
'label' => 'Contenuto',
),
),
'module' => 'Node',
),
'#name' => 'rules_condition_content_is_type',
'#settings' =>
array (
'type' =>
array (
'scheda' => 'scheda',
),
'#argument map' =>
array (
'node' => 'node',
),
),
'#type' => 'condition',
'#weight' => 0,
),
1 =>
array (
'#weight' => 0,
'#info' =>
array (
'label' => 'Controllo 30 gg',
'label callback' => false,
'arguments' =>
array (
'number1' =>
array (
'label' => 'Number 1',
'type' => 'number',
),
'number2' =>
array (
'label' => 'Number 2',
'type' => 'number',
),
),
'module' => 'Rules',
),
'#name' => 'rules_condition_number_compare',
'#settings' =>
array (
'number1' => '<?php strtotime([node:field_sc01-value]-30)',
'number2' => '<?php strtotime(date())',
'operation' => 'equal',
'#eval input' =>
array (
'token_rules_input_evaluator' =>
array (
'number1' =>
array (
0 => 'node',
),
),
'rules_input_evaluator_php' =>
array (
'number1' =>
array (
),
'number2' =>
array (
),
),
),
),
'#type' => 'condition',
),
),
'#actions' =>
array (
0 =>
array (
'#weight' => 0,
'#info' =>
array (
'label' => 'Send a mail to a user',
'arguments' =>
array (
'user' =>
array (
'type' => 'user',
'label' => 'Destinatario',
),
),
'module' => 'System',
'eval input' =>
array (
0 => 'subject',
1 => 'message',
2 => 'from',
),
),
'#name' => 'rules_action_mail_to_user',
'#settings' =>
array (
'from' => '<a href="mailto:[email protected]" rel="nofollow">[email protected]</a>',
'subject' => 'Scadenza [node:field_sc_testo01-raw]',
'message' => 'Gentile cliente,
La presente per comunicarle che il suo contratto è prossimo alla scadenza annuale [node:field_sc01-value].',
'#argument map' =>
array (
'user' => 'user',
),
'#eval input' =>
array (
'token_rules_input_evaluator' =>
array (
'subject' =>
array (
0 => 'node',
),
'message' =>
array (
0 => 'node',
),
),
),
),
'#type' => 'action',
),
),
'#version' => 6003,
),
),
)
?>